A basic compiler based off of thejameskyle's super-tiny-compiler

fizzbuzz.mc 359B

123456789101112131415
  1. (include str maths)
  2. (def fizzbuzz
  3. (assign i 1)
  4. (repeat $1
  5. (assign result "")
  6. (if (eq (maths::modulo i 3) 0) (assign result (str::concat result "Fizz")))
  7. (if (eq (maths::modulo i 5) 0) (assign result (str::concat result "Buzz")))
  8. (if (eq result "") (assign result i))
  9. (log result)
  10. (assign i (maths::add i 1))
  11. )
  12. 1)
  13. (fizzbuzz 100)