Awesome
Tic Tac Toe in PixeLAW with ML Bot
Welcome to the Tic Tac Toe game integrated into the PixeLAW world, where you can challenge an ML bot to a game of Tic Tac Toe!
How to Play
-
Accessing the Game
- Access the PixeLAW platform to play the game.
- Ensure you have an account or access to the PixeLAW world where the game is hosted.
-
Starting the Game
- Locate the Tic Tac Toe game within the PixeLAW world. It should be represented as a grid of pixels.
-
Game Interface
- Interact with the game interface provided within PixeLAW to make your moves.
- The grid represents the Tic Tac Toe board, and you'll choose your moves by selecting grid positions.
-
Playing Against the ML Bot
- Start a game against the ML bot by initiating the game through the interface.
- The ML bot will be making its moves based on its predictions and analysis of the game board.
-
Making Moves
- You'll make your moves by selecting an available cell on the grid to place your 'X.'
- The ML bot will respond with its 'O' move after your turn.
-
Game Progression
- The game will proceed turn by turn until one player achieves a winning pattern or the board fills up (resulting in a draw).
-
Ending the Game
- The game will declare a winner or a draw at the end based on the game outcome.
Technical Details
-
Development of the ML Model
- A simple TensorFlow neural network model was trained using a TicTacToe Jupyter notebook template provided by Gizatech.
- This TensorFlow model was then converted into an ONNX file.
- Giza-cli transpiled the ONNX file into a neural network within the Orion framework, which supports ML functionalities in Cairo. Each neural network layer and bias is represented as different contracts executing matrix operations. The sequential combination of these operations mirrors the output generated by the Python model.
- The AI Bot uses this output to determine the best next move.
- Dojo game logic calls the ML inference code to generate the AI's move.
For more information, you can visit these links:
-
ML Bot Integration
- The ML bot runs its inference on-chain and interacts with the game contract within PixeLAW.
- The bot's moves are determined based on its analysis and predictions using an on-chain machine learning model.
-
Contract Interaction
- The game contract interacts with the core of PixeLAW, changing the state of the world visualized within PixeLAW based on the moves made during the game.
Getting Started (For Developers/Contributors)
-
To contribute or understand the technical aspects:
- Access the game's code repository or development environment.
- Explore the integration of the ML model, game contract, and PixeLAW core.
-
Understanding the PixeLAW Environment:
- Familiarize yourself with PixeLAW's grid-based representation and interaction mechanisms.
Notes
-
This game serves as a demonstration of integrating machine learning within PixeLAW and exploring interactions within decentralized environments.
-
Feel free to explore, contribute, or adapt this project for learning or development purposes.
Enjoy playing Tic Tac Toe against the ML bot within the immersive PixeLAW world! 🎮✨