Skip to content

Commit

Permalink
Merge pull request #6 from shritesh/master
Browse files Browse the repository at this point in the history
My solution for Idris School
  • Loading branch information
bryanhunter authored Feb 28, 2018
2 parents 1a1a356 + 97277bf commit a1f268b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions shritesh+idris/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ibc
16 changes: 16 additions & 0 deletions shritesh+idris/FizzBuzz.idr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fizz_buzz : Nat -> List String
fizz_buzz num =
map fb [1..num]
where
fb : Nat -> String
fb n = if mod n 15 == 0 then
"FizzBuzz"
else if mod n 3 == 0 then
"Fizz"
else if mod n 5 == 0 then
"Buzz"
else
show n

main : IO ()
main = repl "\n> " (\num => unwords (fizz_buzz (cast num)))

0 comments on commit a1f268b

Please sign in to comment.