Skip to content

Commit

Permalink
add Fizz Buzz program in examples directory
Browse files Browse the repository at this point in the history
  • Loading branch information
takano32 committed Nov 28, 2011
1 parent b4308c7 commit 0398a3c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/fizzbuzz.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Fizz Buzz program

var f = "Fizz"
var b = "Buzz"
for i in 1..100:
if i mod 15 == 0:
echo f & b
continue
if i mod 5 == 0:
echo b
continue
if i mod 3 == 0:
echo f
continue
echo i

0 comments on commit 0398a3c

Please sign in to comment.