![]() ![]() Just check the 'AND' of this Value with (XB OR OB). If user chooses UpperLeft, this position has an integer value. So, you can check if a move is valid quite easily. Obviously, ORing "X's board" with "O's board" = ALL POSITIONS from move checking, to board updating and right through to win/loss detection and an appropriate success message, all fit in a handful of ASM instructions. ![]() This code is for an n by n board with n in a row to win (3x3 board requires 3 in a row, etc) public class TripleT ![]() Also since there are a fixed number of moves in a draw tic-tac-toe game once the last move is made if it wasn't a winning move it's by default a draw game. You know a winning move can only happen after X or O has made their most recent move, so you can only search row/column with optional diag that are contained in that move to limit your search space when trying to determine a winning board. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |