Skip to content

Instantly share code, notes, and snippets.

@bitmappergit
Last active June 9, 2019 15:20
Show Gist options
  • Save bitmappergit/1fbf14f61cb76b87cafe5773dd9335a9 to your computer and use it in GitHub Desktop.
Save bitmappergit/1fbf14f61cb76b87cafe5773dd9335a9 to your computer and use it in GitHub Desktop.
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
@jason0597
Copy link

posting fizzbuzz on github yeah baby

@fr3fou
Copy link

fr3fou commented Jun 9, 2019

uwu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment