Meta-Tac-Toe is an exciting variation of the classic game Tic-Tac-Toe. It's a game within a game! In Meta-Tac-Toe, you have a 3x3 meta-board, and each cell of this meta-board contains another 3x3 board, termed as a "small board". The objective is to win the meta-board by securing three small boards in a row, either horizontally, vertically, or diagonally.
- Players alternate turns to place their symbol ('X' or 'O') in an empty cell within a small board.
- The choice of which small board to play in is determined by the cell in which the previous player made their move.
- If a player wins in a small board, their symbol occupies the entire small board.
- The first player to align three of their symbols on the meta-board wins the game.
The game requires Python and Pygame to be installed. If Pygame is not installed, the script will attempt to install it using conda.
pygame
is used for rendering the game board and handling user input.- The
draw_meta_board()
function is responsible for drawing both the meta-board and the small boards, including any 'X' or 'O' symbols. - The
draw_pieces()
function draws the symbols ('X' or 'O') in the respective cells. - The
check_winner_small_board()
function checks for a winner in a small board and returns the winning symbol or None. - The
update_small_board_winner()
function updates a small board with the winner's symbol. - The
check_winner_meta_board()
function checks for a winner in the meta-board and updates a global variable if a winner is found.
- ian.michael.bollinger@gmail.com
- With the assistance of ChatGPT 4.0