-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jacob Mackenzie-Websdale
committed
May 21, 2017
1 parent
08e5c3d
commit 602f50d
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# FizzBuzz | ||
|
||
# call the function defined below | ||
fizzBuzz: 1, 100 | ||
|
||
# define the FizzBuzz function | ||
fizzBuzz :: {start: Int, end: Int}: ( | ||
|
||
# loop i from start to end | ||
i: in.start | i <= in.end | i: i+1 @ ( | ||
|
||
# use conditionals to print the right thing | ||
|
||
i % 3 = 0 && i % 5 = 0 ? | ||
print: "FizzBuzz" | ||
| | ||
i % 3 = 0 ? | ||
print: "Fizz" | ||
| | ||
i % 5 = 0 ? | ||
print: "Buzz" | ||
| | ||
print: i | ||
) | ||
) |