OT: Tic-tac-toe grid

I was just catching up on xkcd, and this showed up:

formatting link

And wanted to shout from the rooftops that in high school we had a Bendix/Control Data G-15, and I "wrote a tic-tac-toe program," but the program was basically a binary tree - I had worked out the whole game tree longhand, on about 12 sheets, in pencil.

I'm way too lazy to go through xkcd's chart, although I wouldn't be surprised to find that it works - there are only 512 possible games, after all. :-)

Cheers! Rich

Reply to
Rich Grise
Loading thread data ...

More like 39,366 possible games.

Reply to
DJ Delorie

Or 362,880 if you play stupidly and don't stop when you win.

Reply to
DJ Delorie

Including mirrors and rotations?

Reply to
krw

Yes. I wrote a program to pre-calculate the best move for every possible game and store them in a database. That's how many entries there are.

Reply to
DJ Delorie

I guess my question, hence your answer, was ambiguous. ;-) Is the 39K number

*including* the mirrors and rotations or excluding them, because they really are the same game. +-+-+-+ +-+-+-+ +-+-+-+ |X| | | |X|O| | | | | | +-+-+-+ +-+-+-+ +-+-+-+ |O| | | == | | | | == | | |O| +-+-+-+ +-+-+-+ +-+-+-+ | | | | | | | | | | |X| +-+-+-+ +-+-+-+ +-+-+-+
Reply to
krw
39k possible absolute board layouts, fewer than that number if you discount mirrors and rotations.
Reply to
DJ Delorie

Thinking more, 9! = 362,880 (10*39K), so...

formatting link
Suggests 255K possible games, figuring that not all games extend to nine moves (and some "games" aren't possible (more than one winner). Taking into account mirrors and rotations, they claim 31896, which is close to your original number. It not as easy a problem as first glance would suggest.

Reply to
krw

I mentioned that a few posts ago too.

formatting link

Well, it was in my case - I just told the computer to play every game, then worked backwards from winning positions to find which moves forced the game to that win. It's not a "big" problem compared to today's computing resources.

Reply to
DJ Delorie

The G-15 was neat. Mapping spacing of sequential commands on the drum for maximum speed, finding ways to use the dinky core memory, etc.

Reply to
Robert Baer

OK, I spoke too soon; you don't put all your Xs or Os on the board at once.

I should have said something like, "512 possible outcomes." Heck, not even that, because there's always a maximum of 5 Xs and 4 Os; there are even less ways to arrange them than 512.

But I admit, there are lots of different ways to get to any given pattern, and I'm WAY too lazy to go through all of tem.

Thanks, Rich

Reply to
Rich Grise

But that list would include moves that, in a real game, would be really stupid. (like, don't block when you should, etc.)

Maybe that's why I only came up with 512 - I threw out all of the dumb moves. ;-D

Cheers! Rich

Reply to
Rich Grise

Stupid moves are still moves.

I doubt it. ;-)

Reply to
krw

The G-15 I used didn't have any core at all - just the rotating drum. There were "short lines," for the accumulator, index registers, and "scratchpad;" is that what you're referring to?

formatting link

Cheers! Rich

Reply to
Rich Grise

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.