5 ms·
The HTML Tic-Tac-Toe Game
- artagnon 17y ago293 separate HTML pages! This is a relic.
- Tichy 17y agoAlmost like a minimalist Searle's Chinese Room :-)
- Tichy 17y agoI 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 17y agoI 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 17y agoNot 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.
- jazzychad 17y ago"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.)
- RiderOfGiraffes 17y agoHis 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 17y agoYes, 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 17y agoSpoiler 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 17y agoYes. http://noveltheory.com/tictac/ObXbOXXOX.htm http://noveltheory.com/tictac/ObXbOXXOX.htm
- rohitpardasani 17y agoGreat 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.
- allenp 17y ago"On a Pentium 133, it requires about 20 seconds to play every game and generate every HTML page!"
- ddrouin 17y agoI want the same with chess. Please.