Can You Guess a Random Number in 20* Guesses?

* Or 10 Guesses, if you're feeling lucky.

Why a Random Number Game?

When I was a kid, my grandparents had an old Macintosh from the 1980s. We would visit regularly in the summer, and playing on the computer was a big part of the fun.

My mother used to sit down and make us a random number game. She had to write the code for it every time, and it would keep my siblings and I entertained for an hour or so.

While I struggled to come up with a "game" idea (game design/development not being on my radar at all), I thought of this and decided that surely, JavaScript could do that as well as whatever language my mother wrote it in back in the 1990s.

So, here we are. Go guess a random number. It's surprisingly soothing.