Skip to content

Instantly share code, notes, and snippets.

@stevenocchipinti
Created May 3, 2017 03:55
Show Gist options
  • Save stevenocchipinti/b1735c00ee6d35c8c2438770685a6a65 to your computer and use it in GitHub Desktop.
Save stevenocchipinti/b1735c00ee6d35c8c2438770685a6a65 to your computer and use it in GitHub Desktop.
Number guessing
require 'io/console'
print "Player 1, pick a number: "
number = STDIN.noecho(&:gets)
puts
puts "Player 2, try to guess the number!"
print "Guess: "
guess = gets
puts number == guess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment