Added fizzbuzz example

This commit is contained in:
Devine Lu Linvega 2024-04-18 11:00:08 -07:00
parent 21782ba7ba
commit 40ef57ebf5
1 changed files with 46 additions and 0 deletions

46
examples/fizzbuzz.modal Normal file
View File

@ -0,0 +1,46 @@
?(?-) (Decimal Base)
<> (0 inc) (1) <> (1 inc) (2) <> (2 inc) (3) <> (3 inc) (4)
<> (4 inc) (5) <> (5 inc) (6) <> (6 inc) (7) <> (7 inc) (8)
<> (8 inc) (9) <> (?a 9 inc) (?a inc 0) <> (9 inc) (1 0)
?(?-) (FizzBuzz)
<> (Fizzbuzz.eval ?0 (0 .3) (0 .5))
(" fizzbuzz\n " Fizzbuzz.print ?0 (0 .3) (0 .5))
<> (Fizzbuzz.eval ?0 (0 .3) ?5)
(" fizz\n " Fizzbuzz.print ?0 (0 .3) ?5)
<> (Fizzbuzz.eval ?0 ?3 (0 .5))
(" buzz\n " Fizzbuzz.print ?0 ?3 (0 .5))
<> (Fizzbuzz.eval (?0 .30) ?3 ?5)
(" (?0 \n) " Fizzbuzz.print (?0 .30) ?3 ?5)
<> (Fizzbuzz.eval (?1 ?0 .30) ?3 ?5)
(" (?1 ?0 \n) " Fizzbuzz.print (?1 ?0 .30) ?3 ?5)
<> (" ?^ " Fizzbuzz.print) (?^ Fizzbuzz.join)
<> (?: Fizzbuzz.join) (?: Fizzbuzz.step)
?(?-) (Modulo)
<> (Fizzbuzz (3 0 .30) ?3 ?5) ()
<> (Fizzbuzz ?0 (3 .3) ?5) (Fizzbuzz ?0 (0 .3) ?5)
<> (Fizzbuzz ?0 ?3 (5 .5)) (Fizzbuzz ?0 ?3 (0 .5))
?(?-) (.step -> Fizzbuzz)
<> (Fizzbuzz.step (?0 .30) (?3 .3) (?5 .5))
(Fizzbuzz (?0 inc .30) (?3 inc .3) (?5 inc .5))
<> (Fizzbuzz.step (?1 ?0 .30) (?3 .3) (?5 .5))
(Fizzbuzz (?1 ?0 inc .30) (?3 inc .3) (?5 inc .5))
?(?-) (Fizzbuzz -> .eval)
<> (Fizzbuzz (?0 .30) (?3 .3) (?5 .5))
(Fizzbuzz.eval (?0 .30) (?3 .3) (?5 .5))
<> (Fizzbuzz (?1 ?0 .30) (?3 .3) (?5 .5))
(Fizzbuzz.eval (?1 ?0 .30) (?3 .3) (?5 .5))
?(?-) (Input)
Fizzbuzz (0 .30) (0 .3) (0 .5)