News for hackers. Stuff that matters.
Re:Implementing Tic Tac Toe with 170mb of HTML – No JavaScri... by p4bl0 on Tuesday November 14, 2023 @07:36AM (#38262553)
There are 9 cells in the game that each can be empty, X, or O. So three states. That is 3^9 = 19683 maximum possible states of the game.

170MB seems like an awefull lot.

Re:Implementing Tic Tac Toe with 170mb of HTML – No JavaScri... by peterhull90 on Tuesday November 14, 2023 @08:41AM (#38263162)
> Popovertarget passes every choice made by the player, for example: x1-o2-x3 means X chooses the first position, O chooses the second and X chooses the third, and so on.

I think this is going to lead to a lot of redundant states, isn't it, because there are multiple paths to get to a particular board layout?

Re:Implementing Tic Tac Toe with 170mb of HTML – No JavaScri... by shultays on Tuesday November 14, 2023 @08:52AM (#38263273)
There would be a lot of illegal states in that number.
Re:Implementing Tic Tac Toe with 170mb of HTML – No JavaScri... by p4bl0 on Tuesday November 14, 2023 @10:45AM (#38264679)
Of course, that's why I said "maximum". That strengthen my point.
Re:Implementing Tic Tac Toe with 170mb of HTML – No JavaScri... by p4bl0 on Tuesday November 14, 2023 @01:05PM (#38267027)
It seems there are only 5478 valid boards.

See my script here: https://news.ycombinator.com/item?id=38266987