I've seen several circuits for two-player tic-tac-toe games on the Internet, but I thought I'd try to design one with these constraints:
done with TTL components only, no CPU minimum number of chips not two player: human versus the board, board makes optimal moves
The circuit uses flip-flops to register both the human and the board's moves. The board has a register which holds the current state of the board's moves. The board state and the user's moves are combined to access a ROM to look up the next board move and any tie or win result. Video at https://www.youtube.com/watch?v=WPPjL46z-Ag, Github repository at https://github.com/DoctorWkt/TTL_TicTacToe
Ok, I think I have the minimal hack (this is HaD after all) to the finite state machine to allow the machine to make the first move. Interpose an AND gate and a normally open switch between S9 and Boardmoves/Move9 like this:
S9 ----------------
AND ----> Boardmoves/Move9
S13-NO/SW---
Location 0 in the state lookup ROM is changed to 0x0D, which causes the FSM to loop attempting to turn on Boardmoves/LED9 via S13 but is blocked by the open switch. When the user presses this "you go first" switch, LED9 is turned on, and then play proceeds as usual.
Entries in the ROM which were previously unreachable (e.g. 5 machine moves) need to be fixed to indicate tie or win.
One motivation for this mod is that when the machine goes first on a corner, it is possible to trap the user if they do not reply with centre.
Nice exemplar of a finite state machine implementation by the way. 👍
Actually, I'm using a 32kx8 ROM so there is more space in there for other moves. Why not a switch and pull-down resistor connected to the A13 address line on the ROM. Low selects the current 8K of ROM where the user moves first. High selects the 8K where the board moves first. It's too late for my PCBs (they are ordered), but I can try this out on the breadboard in the next few days.
I've generated the new 8K set of moves and states. I've rewrired the Logisim version to have a "move first" selector and it all works. Next up, try it out on the breadboard. After that, change the schematic and PCB design.
It's not hard to add. You just need another switch for the null (I pass) move and a initial state in the ROM. Machine can then make a predetermined first move, probably corner.
Yes, I think it will require one extra latch, but no LED, and 10 bits of state. What would make it cute would be the machine making a hmmm sound for a few seconds before "making its move". 😉
oh welldone brother I am play this game Tic Tac Toe Multiplayer at a free time this is very best game for time pass