Giter Site home page Giter Site logo

ipsychonaut / meta-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

Meta-Tac-Toe is an exciting twist on the classic game of Tic-Tac-Toe. The game board is a 3x3 grid, and each cell in this grid contains another 3x3 grid known 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.

License: The Unlicense

Python 100.00%

meta-tac-toe's Introduction

Meta-Tac-Toe

Introduction

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.

How to Play

  1. Players alternate turns to place their symbol ('X' or 'O') in an empty cell within a small board.
  2. The choice of which small board to play in is determined by the cell in which the previous player made their move.
  3. If a player wins in a small board, their symbol occupies the entire small board.
  4. The first player to align three of their symbols on the meta-board wins the game.

Installation

The game requires Python and Pygame to be installed. If Pygame is not installed, the script will attempt to install it using conda.

Code Structure

  1. pygame is used for rendering the game board and handling user input.
  2. The draw_meta_board() function is responsible for drawing both the meta-board and the small boards, including any 'X' or 'O' symbols.
  3. The draw_pieces() function draws the symbols ('X' or 'O') in the respective cells.
  4. The check_winner_small_board() function checks for a winner in a small board and returns the winning symbol or None.
  5. The update_small_board_winner() function updates a small board with the winner's symbol.
  6. The check_winner_meta_board() function checks for a winner in the meta-board and updates a global variable if a winner is found.

Authors

meta-tac-toe's People

Contributors

ipsychonaut avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.