Live data from Hacker News

Solving a Childhood Mystery: How BASIC Games Learned to Win

sublevelgames.github.io

1–10 of 30 posts

Solving a Childhood Mystery: How BASIC Games Learned to Win

#1
Hello HN!

As a teenager, I had this BASIC Computer Games book with a game called HEXAPAWN. Lines 900-970 were just cryptic numbers that made no sense to me. Finally figured it out decades later.

Turns out it's machine learning from the 1970s! The AI learns by literally deleting bad moves from an array. After losing ~10 games, it becomes unbeatable. Just 19 board states, no neural networks, no fancy algorithms.

Martin Gardner (who wrote about it) also mentioned MENACE - a tic-tac-toe learning machine made with matchboxes and beads. Same principle, physical implementation.

Made a JavaScript version if anyone wants to try. The AI really does get better.

Solving a Childhood Mystery: How BASIC Games Learned to Win
sublevelgames.github.io

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#4
There was an article in 'The Rainbow' about the tic-tac-toe bead method of machine learning. For some reason, that particular method stuck in my head long after most other things I read in computer magazines of the time faded away. Maybe due to both the simplicity of tic-tac-toe and of the algorithm itself.

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#5

So basically it has a table of all possible moves, and after losing a game, it deletes a move that led to the defeat? Then why not simply have a smaller table of moves right from the start, with losing moves already removed?

Because that wouldn't help readers understand how the computer learns with this simple algorithm.

People bought the book to not only play, but also learn from simple games. There's nothing quite like it nowadays.

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#6
post #5

So basically it has a table of all possible moves, and after losing a game, it deletes a move that led to the defeat? Then why not simply have a smaller table of moves right from the start, with losing moves already removed?

Because that wouldn't help readers understand how the computer learns with this simple algorithm. People bought the book to not only play, but also learn from simple games. There's nothing quite like it nowadays.

OK, that makes sense - the game has a better playability if it starts on an average level and "learns" over time.

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#7

So basically it has a table of all possible moves, and after losing a game, it deletes a move that led to the defeat? Then why not simply have a smaller table of moves right from the start, with losing moves already removed?

How would it learn without playing against the person already?

It gives a sense of intelligence the way it’s played now but it’s a simple algorithm.

Eventually the computer runs out of things to remove and it has to give up.

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#9
post #5

Earlier quoted context omitted.

Because that wouldn't help readers understand how the computer learns with this simple algorithm. People bought the book to not only play, but also learn from simple games. There's nothing quite like it nowadays.

OK, that makes sense - the game has a better playability if it starts on an average level and "learns" over time.

No, that's not why. The comment you're replying to gave a different reason that it was done that way. That comment explained, twice, that it's not merely, or even primarily, to improve the game's playability; it was to serve as an executable demonstration of the matchbox learning algorithm.

The blog post explained that the game derived from Martin Gardner's popularization of Donald Michie's work on the algorithm.

The output of the program also outlines the algorithm, using a series of PRINT statements.

Finally, the explanatory text in the book also explains the algorithm, in somewhat more depth.

Like many of the games in the book, it had a didactic purpose. It's not about improving playability.

Re: Solving a Childhood Mystery: How BASIC Games Learned to Win

#10
BTW David Ahl has placed all of his work, including this book, into the public domain https://blog.adafruit.com/2022/06/16/david-ahl-places-all-hi... and so we can link to the Hexapawn page in the original book https://dn790005.ca.archive.org/0/items/Basic_Computer_Games...

Unfortunately I do not know of an online source for the Korean edition that so inspired the original poster.

Post reply on HN