A mechanical computer out of boxes that through reinforcement learns to play Tic-Tac-Toe.
View Video
·
View Writeup
In the project “Tic-Tac-Toe Box AI”, I built a mechanical computer out of boxes that through reinforcement learns to play Tic-Tac-Toe for my application to the Science Ambassador Scholarship.
The project provides a unique and tangible way to simplify the concepts of reinforcement learning.
Quick Stats: 121 boxes, 150+ hours spent creating, 2897 lines of code, 7 new friends made!
-
Mechanical Computer: Built out of 121 boxes representing the different board states of Tic-Tac-Toe. Every box contains differently colored beads representing the various available squares in each given scenario. Through training, the boxes tend to only contain the beads corresponding to the best moves.
-
Game Board: Integrated with an Arduino and push buttons to detect when you place an X or an O on the board. Communicates with the web app.
-
Web Application for Logging: To avoid manually tracking the bead counts in each box, I built a website to automatically keep track of and highlight each move.
Watch the 3-min video here
View the full writeup here
The CAD-files used in this project are found under the folder cad
. All files use the illustrator extension .ai
.
- box.ai: The box used to hold the beads for each board configuration.
- box-fronts.ai: Each of the 121 custom fronts.
- board.ai: The tic-tac-toe board.
- board-pieces.ai: The "X" and "O" pieces for the board.
- 3rd-tower.ai: The tower housing the boxes for the possible moves at turn 3.
- 5th-tower.ai: The tower housing the boxes for the possible moves at turn 5.
The webapp is developed using node.js
and the files are found under the folder webapp
. To run the server locally, clone the repo and start the webserver using node:
- Clone the repository:
git clone https://github.com/aliceheiman/menace.git
cd menace/webapp
- Install dependencies:
npm install
- Run the application or start the development server:
npm start
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Alice Heiman - aheiman@stanford.edu
Project Link: https://github.com/aliceheiman/menace
Thank you to Mscroggs who built an amazing MENACE out of matchboxes and inspired me to build my own MENACE version. I built on top of Mscroggs article build your own menace. There, you can also find PDFs of all board states.