Skip to content

A mechanical computer out of boxes that through reinforcement learns to play Tic-Tac-Toe.

Notifications You must be signed in to change notification settings

aliceheiman/menace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


MENACE: Tic-Tac-Toe Box AI

A mechanical computer out of boxes that through reinforcement learns to play Tic-Tac-Toe.
View Video · View Writeup

About The Project

Menace Computer

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!

Menace Concept

  • 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.

Video and Writeup

Watch the 3-min video here

View the full writeup here

Usage

CAD Illustrator Files

The CAD-files used in this project are found under the folder cad. All files use the illustrator extension .ai.

Menace Boardstates

  • 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.

Webapp

Menace Webapp

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:

  1. Clone the repository:
git clone https://github.com/aliceheiman/menace.git
cd menace/webapp
  1. Install dependencies:
npm install
  1. Run the application or start the development server:
npm start

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Alice Heiman - aheiman@stanford.edu

Project Link: https://github.com/aliceheiman/menace

Acknowledgments

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.

(back to top)

About

A mechanical computer out of boxes that through reinforcement learns to play Tic-Tac-Toe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published