From 2f24c7d83fefd5a0410abf23a8b6940075b62f01 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 29 Apr 2024 18:06:17 -0700 Subject: [PATCH] Added fizzbuzz-alu example --- examples/fizzbuzz-alu.modal | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 examples/fizzbuzz-alu.modal diff --git a/examples/fizzbuzz-alu.modal b/examples/fizzbuzz-alu.modal new file mode 100644 index 0000000..3371eda --- /dev/null +++ b/examples/fizzbuzz-alu.modal @@ -0,0 +1,9 @@ +<> (fizzbuzz ?x ?x) (done.) +<> (?x Int 0 Int 0 test) (?(?: ?:) (Fizz Buzz\n)) +<> (?x Int 0 Int ?z test) (?(?: ?:) Fizz\n) +<> (?x Int ?y Int 0 test) (?(?: ?:) Buzz\n) +<> (?x Int ?y Int ?z test) (?(?: ?:) (?x \n)) +<> (?x eval) (?x ?((?0 ?1 ?:) (Int ?:)) ?x 3 % ?((?0 ?1 ?:) (Int ?:)) ?x 5 % test) +<> (fizzbuzz ?x ?y) (?x eval fizzbuzz ?((?0 ?1 ?:) ?:) ?x 1 + ?y) + +fizzbuzz 1 30 \ No newline at end of file