We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1a1a356 + 97277bf commit a1f268bCopy full SHA for a1f268b
shritesh+idris/.gitignore
@@ -0,0 +1 @@
1
+*.ibc
shritesh+idris/FizzBuzz.idr
@@ -0,0 +1,16 @@
+fizz_buzz : Nat -> List String
2
+fizz_buzz num =
3
+ map fb [1..num]
4
+where
5
+ fb : Nat -> String
6
+ fb n = if mod n 15 == 0 then
7
+ "FizzBuzz"
8
+ else if mod n 3 == 0 then
9
+ "Fizz"
10
+ else if mod n 5 == 0 then
11
+ "Buzz"
12
+ else
13
+ show n
14
+
15
+main : IO ()
16
+main = repl "\n> " (\num => unwords (fizz_buzz (cast num)))
0 commit comments