daniel 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

benjamin_guessing_game by daniel

Shoes.app do
 background white
 title "gjett det riktige nummre",
        :align => "center",
       :font => "Trebuchet MS",
       :stroke => black

 # lag en tekstboks.
 line = edit_line
 hemmelig_nummer = (0..100).rand
 # lag en knapp
 button "Press" do
   gjette = line.text.to_i
   if gjette == hemmelig_nummer
     # du har gjettet riktig, hva gjør vi naa?
       @note.replace "du gjettet riktig!"

   else
    # du har gjettet feil, proov igjen.
    if gjette < hemmelig_nummer
     # du har gjettet for lavt.
       @note.replace "gjettet for lavt"
    end

    if gjette > hemmelig_nummer
    # du har gjetter for høyt
     @note.replace "gjettet for høyt"
    end
   end
  end
  @note = para "skriv inn et tall."

 end