
The HTML Tic-Tac-Toe Game - rayvega
http://noveltheory.com/tictac/
======
RiderOfGiraffes
His underlying engine that generated the pages isn't very good because it's
easy to beat. Unless that was deliberate, but he doesn't say so.

~~~
jazzychad
Yes, interesting. Optimal play should end in a tie every game. He says there
are 2 ways for X to win (mirror images of each other). In those cases, O's
second move was not optimal.

~~~
pmjordan
Spoiler alert! :)

To beat it: X in a corner, O in the centre, X in the opposite corner. O's move
of course must not be in the centre or any of the corners; that way the second
O can be placed such that the third X is forced to be in a bad spot.

~~~
kordless
Yes. <http://noveltheory.com/tictac/ObXbOXXOX.htm>

------
Tichy
I would have hoped that it uses CSS logic. Should be doable? I am not a CSS
wizard (still look up things on the fly), but I think there are rules for "if
class x is below class y in the hierarchy then..." and for selected and
unselected links. Perhaps that is sufficient to create a much more compressed
CSS only Tic Tac Toe?

~~~
pmjordan
I suspect this to be between difficult and impossible to do as CSS doesn't
have any way of knowing the past; I don't think there's a way to remember
moves as such. All I can think of is to somehow have an #anchor for each
possible configuration and to select the visible links for the next move
depending on which anchor is active. This isn't really any more elegant than
having a separate page for each configuration; you're not encoding any actual
logic in the CSS, just the graph of possible outcomes.

~~~
Tichy
Not really encoding logic, true - but perhaps a more compressed representation
would be possible. I am not sure one would have to list every possible
configuration.

------
rohitpardasani
Great thing. It reminded me of the time when I used heuristics for developing
tic-tac-toe in C. And realized that to make computer play a simple logical
game it takes hundreds of lines of code. So I really appreciate the amount of
thinking gone in developing such AI entirely from discrete states of HTML
pages.

------
artagnon
293 separate HTML pages! This is a relic.

~~~
Tichy
Almost like a minimalist Searle's Chinese Room :-)

------
jazzychad
"A strange game. The only winning move is not to play." - Joshua

(Incidentally, that movie sparked my interest in both artificial intelligence
and telephony programming.)

------
allenp
"On a Pentium 133, it requires about 20 seconds to play every game and
generate every HTML page!"

------
ddrouin
I want the same with chess. Please.

~~~
ca98am79
There are more possible games of chess than there are atoms in the universe

~~~
davatk
I think he was being facetious.

