Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created June 27, 2011 11:36
Show Gist options
  • Select an option

  • Save KOBA789/1048713 to your computer and use it in GitHub Desktop.

Select an option

Save KOBA789/1048713 to your computer and use it in GitHub Desktop.
FizzBuzz on Ruby
i = 1
while i < 100
printf i.to_s + "\r"
if i % 3 == 0
printf "Fizz"
end
if i % 5 == 0
printf "Buzz"
end
printf "\n"
i += 1;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment