Skip to content

Instantly share code, notes, and snippets.

@NoMan2000
Created April 15, 2019 00:23
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 NoMan2000/3baa57dd4672243016dc4ccbeadbca92 to your computer and use it in GitHub Desktop.
Save NoMan2000/3baa57dd4672243016dc4ccbeadbca92 to your computer and use it in GitHub Desktop.
A simple ruby program
p "How many items do you want?"
input = gets.to_i
(1..input).each do |n|
if n % 15 == 0
p "FooBar"
elsif n % 3 == 0
p "Foo"
elsif n % 5 == 0
p "Bar"
else
p n
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment