Posted by: 6ixMediaSA Category: Code Comments: 0

secret = rand(1..10)
guess = 0
while guess != secret
  print "Guess 1-10: "
  guess = gets.to_i
  puts guess < secret ? "Higher!" : "Lower!" if guess != secret
end
puts "Correct!"

Leave a Reply

Your email address will not be published. Required fields are marked *

Let’s Get in Touch

We’re interested in talking
about your business.