Skip to content

Instantly share code, notes, and snippets.

@pchittum
Last active February 24, 2017 23:32
Show Gist options
  • Save pchittum/c676957c1bb52485cae5f2b9808d82c0 to your computer and use it in GitHub Desktop.
Save pchittum/c676957c1bb52485cae5f2b9808d82c0 to your computer and use it in GitHub Desktop.
Fizz Buzz
for n <- 1..20 do
cond do
rem(n, 15) == 0 -> "fizzbuzz"
rem(n, 5) == 0 -> "buzz"
rem(n, 3) == 0 -> "fizz"
true -> n
end
end
for (var i = 1; i <= 20; i++){
i % 3 === 0 ?
i % 5 === 0 ?
console.log('fizzbuzz') :
console.log('fizz') :
i % 5 === 0 ?
console.log('buzz') :
console.log(i) ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment