Last active
June 9, 2019 15:20
-
-
Save bitmappergit/1fbf14f61cb76b87cafe5773dd9335a9 to your computer and use it in GitHub Desktop.
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
inc = 1 #the counter variable | |
until inc == 101 #repeats until inc equals 101 | |
if inc % 3 == 0 && inc % 5 != 0 #check if inc is a multiple of three and not five and do what is on the next line | |
puts "Fizz" #prints Fizz if the above is true | |
end #end if | |
if inc % 5 == 0 && inc % 3 != 0 #check if inc is a multiple of five and not three and do what is on the next line | |
puts "Buzz" #prints Buzz if the above is true | |
end #end if | |
if inc % 5 == 0 && inc % 3 == 0 #check if inc is a multiple of three and five and do what is on the next line | |
puts "FizzBuzz" #prints FizzBuzz if the above is true | |
end #end if | |
if inc % 5 != 0 && inc % 3 != 0 #check if inc is not a multiple of three or five and do what is on the next line | |
puts inc #prints current number if the above is true | |
end #end if | |
inc = inc + 1 #increase inc by one | |
end #end until |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
posting fizzbuzz on github yeah baby