Skip to content

NUCES-Khi/supertictactoe-mudasir-irtaza

Repository files navigation

This code implements a Super Tic-Tac-Toe game with a graphical user interface (GUI) using the Tkinter library in Python. The game allows two players to take turns making moves, with one player being the user and the other player being an AI opponent that uses the minimax algorithm.

The key features of the game: 1.GUI Interface: The game features a graphical user interface built with Tkinter, providing a user-friendly way to interact with the game. 2.Super Tic-Tac-Toe Rules: The game follows the rules of Super Tic-Tac-Toe, where each cell on the board contains a 3x3 grid, and winning requires forming a line of three symbols either vertically, horizontally, or diagonally within each grid and across grids. 3.Minimax AI Opponent: The AI opponent utilizes the minimax algorithm to make optimal moves, ensuring a challenging gameplay experience for the user. 4.Dynamic Board: The game board dynamically updates to reflect the current state of the game, including player moves and AI responses.

Code Explanation: Initialization: The code initializes the Tkinter window and sets up the game board. Game Logic: It includes functions for handling player moves, updating the game state, and evaluating the current game state. Minimax Algorithm: The minimax algorithm is implemented to allow the AI opponent to make strategic decisions based on the current game state. GUI Interaction: The code handles user input through button clicks on the GUI, allowing players to make moves interactively.

How to Run the code? As the codes are submitted into .ipynb file.

1-Ensure Python is installed on your system. 2-Execute the Python script SuperTicTacToewithGUI.ipynb 3-The game window will appear, allowing you to interact with the GUI and play against the AI opponent. 4-Main Function: The main function creates an instance of the game GUI and starts the Tkinter event loop. Otherwise, you can use google colab online plateform to see execution.

Code submitted in both (with GUI and without GUI) format for better understanding.

About

supertictactoe-mudasir-irtaza created by GitHub Classroom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published