![]() ![]() We use this to check for all the rows and if any other value other than False is returned then there is a win. Here we have a function called row_win that checks to see if there is any other move other than 'x' and if so that means the condition for a win has been violated thus no win for the row checked. Thats it for now, this will form the foundation for calculating the other wins too (keep reading and you'll see why). STEP 2: How to calculate win for step 1.1: same move spans across (horizontally) on one row # assuming we are checking for the move x NOTE: There will always be only 2 digonals. if the same move spans diagonally across the game, that is or.if the same move spans vertically along a column, that is or or are all of the same move.if the same move spans across (horizontally) on one row, that is, or or are all of the same move. ![]() Now, lets talk about the implementation of the algorithmįor this example, we will be taking X as our "winning" move (to make things easier). Why? This is because we need to keep track of a move and the tile number the move was made on. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |