Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exercise: Guess number

When the page is loaded the computer "thinks" about a random whole number between 1 and 200, and displays an input box and a button "guess". The user types in a number and the computer will check if the given number is "smaller" or "larger" than the number it "though" about, or if they happen to be equal.

Once that's done, change the solution so it will count how many times has the user guessed before the coreect number was found.