-
-
Save AnonymousWS/1036b75c56b01f8a721b 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
num = rand(100) | |
puts "I am thinking of a number between 1 and 100, try figure out what it is: | |
" | |
while true do | |
user_input = gets.chomp.to_i | |
if user_input == num | |
puts "Thats correct! I was thinking about #{num} \n " | |
break | |
elsif user_input > num | |
puts "I am thinking off a smaller number, please guess again: " | |
elsif | |
puts "I am thinking off a bigger number, please guess again: " | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment