GithubHelp home page GithubHelp logo

wesleyyc / tic-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 1.0 2.59 MB

A perfect Tic Tac Toe player using the strategy in Newell and Simon's 1972 tic-tac-toe program

License: MIT License

Python 100.00%

tic-tac-toe's Introduction

Tic-Tac-Toe

We are currently working on a raspberry pi intergration to bring this virtual board game to an actual board game.

A perfect Tic Tac Toe player using the strategy in Newell and Simon's 1972 tic-tac-toe program (http://en.wikipedia.org/wiki/Tic-tac-toe#Strategy).

Feel free to play around with the code and let me know if there are any bugs.

Software Setup

Python Version

Please make sure you are running Python 2 instead of Python 3.

Run the standalone game without a Raspberry Pi

python <project>\original_code\tic_tac_toe.py

Run the game on Raspberry Pi

  1. Open up terminal in Raspbian
  2. Start Python 2 shell with IDLE as Root so that you can access GPIO on the board
sudo idle &
  1. Open up the project in an editer: File -> Open -> \pi_interface.py
  2. Inside the editer, hit F5 to run!

Hardware Setup

We are currently setting up and connecting the game board using a breadboard and jumper wires. After we are done debugging, we will see if we can get a PCB and solder the components in!

Circuit Components

Component Count
Bi-color LEDs 9
push buttons 3
Resisotr ~330 Ohm 1
Jumper wires At least 19

Circuit Schematics

Coming soon...

Most of the code is finished in less than three hours, so there are a lot of if/else statment and not perfectly structured. So pardon me for the mess and feel free to fork/modify the code.

tic-tac-toe's People

Contributors

serinatan avatar wesleyyc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

tic-tac-toe's Issues

Green light on the LED faints away...

The first user input lights up the corresponding green light accordingly. The second user input triggers a second green light. However, from this point onward, no green light can be lit up and the first two turn off as well. The green light seems a lot dimmer than normal. The LEDs can light up red with no issues throughout the game.

I am suspecting there is a limit on how much power the GPIO ports can output overall. Also, the green light somehow consumes more more than the red light. My next step is to dig into the power limit of the pi and see if I wire up the green light node with different resistors.

User Wins!

The putting order is (1,1), (3,3), (1,3), (2,3).

Winning the Computer...

Follow these coordinates and the user is able to win the computer...
0,2
2,1
1,0
0,0
2,0

I am suspecting something is messed up in fork... Still investigating.

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.