jsager12 and many others are using Hackety Hack to learn how to code.

Hackety Hack is a free program for Windows, Mac OS X and Linux that can teach you how to make games, applications and more and share those programs with your friends. You can ask other budding programmers questions and follow them to see what code they're working on through the Hackety Hack website.

Sign up Learn More

guessing_game by jsager12

number = (rand*10).ceil
alert "I have a number, between 0 and 10. Can you guess what it is?"
alert "You have 5 guesses."
5.times do
  guess = ask "Number?"
  if guess.to_s == number.to_s
    alert "Correct!"
    break
  else
    if guess.to_s > number.to_s
      status = "It's a smaller number"
    else
      status = "It's a bigger number"
    end 
    alert "Try again!" + status
  end
 end