4 ms·
A very long time ago I used the idea that there aren't actually that many possible tic-tac-toe boards to make an HTML player that is just static web pages http
by nickcw 3y ago
A very long time ago I used the idea that there aren't actually that many possible tic-tac-toe boards to make an HTML player that is just static web pages
https://www.craig-wood.com/nick/oxo2d/ https://www.craig-wood.com/nick/oxo2d/
I generated this with a C program that tried to minimise the number of boards. There are 427 pages including the index.
This has been through quite a few revisions of my website and I lost the source to the C program so it remains a historical artifact only!
- kej 3y agoThat reminds me of a former coworker who wrote a paperback version of the game Nim (the math game where you remove sticks). It worked like a choose your own adventure where each possible move had a page number to jump to.
- abecedarius 3y agoSince your C is lost here's Python code in an old article of mine: https://codewords.recurse.com/issues/four/the-language-of-choice https://codewords.recurse.com/issues/four/the-language-of-ch... -- at least it gave the same number 427. (About halfway down the page. It's as an example application of binary decision diagrams.)
- ngcc_hk 3y agoTotally lost when you use python to define a domain specific language. Cannot get that most quoted paper and its idea. I wonder whether a lisp based one would be better. Please no C as well.
- canadianfella 3y agoI read your comment a few times and I have no idea what you are are trying to say. Can you explain?
- sodapopcan 3y ago“Something something only use programming languages I like.”
- abecedarius 3y agoSorry, the article was finished in a bit of a hurry. (Not sure what you mean about a domain specific language.) Maybe if the writing's too bad, the tic-tac-toe code might still be readable, in the linked repo https://github.com/darius/mccarthy-to-bryant https://github.com/darius/mccarthy-to-bryant (tictactoe.py and ttt_*). Python 2 (I said it was old).
- jgrahamc 3y agoOh man. This brought back memories. Back in 2007, I did this by embedding clickable boards in Reddit comments, with all the comments linked together. The idea was "playable tic-tac-toe inside Reddit comments". Reddit had to kill my account because the process doing comment indexing was blowing up. But, hey, Steve Huffman sent me a Reddit sticker!
- gumby 3y agoSeems appropriate given that a Huffman code is a compression strategy.
- Biganon 3y agoThere's a book version of tic tac toe Every page is a grid state and each cell contains the number of the page you're supposed to go to if you pick this cell
- pimlottc 3y agoThis is a great example of how you can trade time for space. There’s no reason you couldn’t do the same thing for chess, except it would take, er, quite a bit of disk space…
- ithkuil 3y agothere are even more possible variations of chess games than there are atoms in the observable universe.
- pimlottc 3y agoYeah, I'd definitely have to delete some old emails.
- zimpenfish 3y agoMy favourite "big but comprehensible generation number" is the count of unique shuffles of a standard deck of 52 cards. (this is my best recollection of the "this is how insane it is" story, numbers may be slightly off) Iterate through a billion possible shuffles a second and every yearly anniversary, take a 1M pace around the equator. When you get back to your starting point (after 40,075 years), take 1cc out of the Pacific Ocean. When the ocean is empty, put one A4 piece of 0.05mm paper on a pile. Now you start filling the ocean 1cc every circumnavigation. When it's full, A4 piece of paper on the pile. etc. By the time you exhaust the list of shuffles, the pile will be 188 light years tall.
- koliber 3y agoFor something slightly more practical here's a printable PDF representation of googolplex: http://www.googolplexwrittenout.com/ http://www.googolplexwrittenout.com/
- cpach 3y agoI remember that 'idlewords once ran out of disk space on his server because a Pinboard user bookmarked some page that had written out a very large number (googolplex or similar) and the archived HTML was something like 50 GB or so :) (I don’t remember the exact details now so take it with a grain of salt.)
- reaperman 3y agoIs there an inaccuracy for https://www.craig-wood.com/nick/oxo2d/b2/ https://www.craig-wood.com/nick/oxo2d/b2/ ? I believe the optimal response to: X . . . O . . . . Should be X . . . O . . . X Which offers a reasonable opportunity for "O" to mess up by choosing a corner. But instead your script plays X X . . O . . . . Which guides the human player to reflexively counter accurately without thinking.
- mizzao 3y agoThe game is playing a minimax strategy, which means if you go first it will at least draw, and if it goes first it will never lose.
- reaperman 3y agoMinimax seems logical on its face... but it costs nothing to slightly increase % chance of a win. And wins have some value over draws.
- naniwaduni 3y agoThe immediate threat offers the opponent 5/6 losing moves, whereas yours offers only 2/6 losing moves. The rationale is quite similar to your choice of the initial corner move rather than center: there are 7/8 losing responses to turn 1 corner, and only 4/8 losing responses to turn 1 center. But you'll probably get more humans to pick a losing side response to center than pick a losing non-center response to corner.
- reaperman 3y ago> The immediate threat offers the opponent 5/6 losing moves, whereas yours offers only 2/6 losing moves. This would be relevant if humans made their choice with a significant amount of randomness. But I argue that in this specific situation, very nearly every human will play to block the obvious threat. I believe humans will be more likely to pick one of the two losing moves in the slightly more abstract/delayed threat scenario, than they would be to pick one of the 5 losing moves in the immediate threat scenario.
- fhars 3y agoThere is a tic-tac-toe system that learns to play using reinforcement learning built of matchboxes. Designed in 1961. https://en.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine https://en.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_...
- ufocia 3y agoInteresting. Only 304 unique permutations so 9 bits is more than anyone would ever need for a tic-tac-toe state?