Created
September 4, 2011 20:47
-
-
Save takahisa/1193486 to your computer and use it in GitHub Desktop.
HeadacheでFizzBuzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let fizz_buzz : \n -> | |
let fizz_buzz : \i -> \n -> | |
( let m : ( + i 1 ) -> | |
( cond ( > i n ) () | |
( cond ( = ( % i 15 ) 0 ) ( >>= ( puts "fizzbuzz" ) ( fizz_buzz m n ) ) | |
( cond ( = ( % i 3 ) 0 ) ( >>= ( puts "fizz" ) ( fizz_buzz m n ) ) | |
( cond ( = ( % i 5 ) 0 ) ( >>= ( puts "buzz" ) ( fizz_buzz m n ) ) | |
( >>= ( puts i ) ( fizz_buzz m n ) ) ) ) ) ) ) -> fizz_buzz 1 n ; | |
let main : fizz_buzz 100 ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment