Skip to content

Instantly share code, notes, and snippets.

@trivett
Created February 27, 2014 16:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trivett/9253149 to your computer and use it in GitHub Desktop.
Save trivett/9253149 to your computer and use it in GitHub Desktop.
this is numberwang!
# http://www.youtube.com/watch?v=qjOZtWZ56lc
class Numeric
def is_numberwang?
rand(5) == 0
end
end
i = 0
def play(i)
while i < 2
input = gets.chomp.to_i
if input.is_numberwang?
puts "that's numberwang!"
puts "Julie, your turn."
input = gets.chomp.to_i
i += 1
else
puts "sorry."
input = gets.chomp.to_i
puts rand(30)
end
end
end
puts "let's play numberwang!"
puts "Simon, you go first."
play(i)
i = 0
puts "let's rotate the board!!!"
play(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment