Skip to content

Instantly share code, notes, and snippets.

@cquinn
Created July 5, 2015 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cquinn/9b106842cec90460ef19 to your computer and use it in GitHub Desktop.
Save cquinn/9b106842cec90460ef19 to your computer and use it in GitHub Desktop.
Minimalistic FizzBuzz in Pony lang
use "collections"
actor Main
new create(env: Env) =>
try
let n = env.args(1).i32()
for i in Range[I32](1, n) do
env.out.print(fizzbuzz(i))
end
end
fun fizzbuzz(n: I32): String =>
if (n % 15) == 0 then
"FizzBuzz"
elseif (n % 5) == 0 then
"Buzz"
elseif (n % 3) == 0 then
"Fizz"
else
n.string()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment