News for hackers. Stuff that matters.
Re:Board Games of the Ancient World by tcgv on Friday February 07, 2020 @02:39PM (#22269941)
I also had to implement a Tic Tac Toe "AI" when I was in college about a decade ago. Last year I was revisiting my college files backup and decided to upload it into GitHub:

- https://github.com/TCGV/TicTacToe.

The AI player was implemented using the Minimax algorithm, and can never be beaten ;)

Re:Board Games of the Ancient World by gnulinux on Friday February 07, 2020 @05:13PM (#22271647)
Sorry very tangential.

One time I wrote something like this, and shared on reddit. Like you, I used minimax to solve tic tac toe. My comment was downvoted to oblivion and one highly upvoted person wrote:

> You don't need "AI" to solve tic tac toe, it's a solved problem!

Re:Board Games of the Ancient World by tcgv on Saturday February 08, 2020 @11:37AM (#22276591)
Damn...

Even though it truly is a solved problem, it's much more intuitive (and fun) to implement a tic-tac-toe solver from scratch using minimax than any lookup tables heuristic.

Since it is a generic solution, I believe the minimax solver can also be easily modified to implement an "AI" player for that Roman version of the game as well, where pieces are removed.

By the way, using minimax was also one of that college task requirements!

Re:Board Games of the Ancient World by user5994461 on Friday February 07, 2020 @06:08PM (#22272142)
And here's a picture of the solution. https://xkcd.com/832/

Could fit on a sheet of paper indeed.

Re:Board Games of the Ancient World by praptak on Saturday February 08, 2020 @02:55AM (#22274600)
Someone actually implemented a tic-tac-toe player in Reddit comments using character graphics and cross-comment links.
Re:Board Games of the Ancient World by abhgh on Saturday February 08, 2020 @02:36AM (#22274526)
Brings back memories. I think implementing an AI for tic-tac-toe was one of my first complete implementations of a RL algorithm; circa 2008, I think :)