Skip to content

Commit a1f268b

Browse files
authored
Merge pull request #6 from shritesh/master
My solution for Idris School
2 parents 1a1a356 + 97277bf commit a1f268b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

shritesh+idris/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.ibc

shritesh+idris/FizzBuzz.idr

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
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

Comments
 (0)