GithubHelp home page GithubHelp logo

tictactoe's Introduction

TicTacToe

Tic tac toe game. Try not lose!

Copyright: 2017, Shaojie Wang ([email protected])

Environment: Fedora(Linux version 4.12.13-300.fc26.x86_64); python3 interpreter (version 3.6.2).

Guidance(steps): 0. Note that "ttt.py" is for normal 3*3 tic-tac-toe, and "attt.py" is for advanced tic-tac-toe.

  1. Open terminal under the current path of tic-tac-toe programs.
  2. Run the code with command line, "python3 ttt.py" for example.
  3. Firstly, you should enter an 'x' or 'o' (quotation symbols not included) to indicate your side ('x' always for offensive side, and 'o' for defensive side).
  4. After a board is shown on screen, you are asked to input your move. For simple 3*3 tic-tac-toe game, you only need to input one integer from 1 to 9, representing for the position as is shown below. 1 2 3 4 5 6 7 8 9 For advanced tic-tac-toe, you need to input two integers, both from 1 to 9. The first integer is for which board to play on, and the second one is for which position on that chosen board.
  5. Each time you or the computer makes a move, a current board(state) will be shown on the screen. If the game is over, the result of the game will be shown.
  6. After that, a new game starts immediately (jump to step 3).
  7. Ctrl+C to exit the program.

Cautions:

  1. MUST use python3! NOT python!
  2. The input should not contain any characters other than whitespace characters in the beginning and ending.
  3. For advanced tic-tac-toe, you can input whatever you want (except '\n') between the two integers to separate them.
  4. Make sure you type '\n' only when you finished your current input.

Updates:

  • For the combat.py, you need to modify the evaluation functions manually. Automatic learning may come after.

tictactoe's People

Contributors

jossome avatar

Watchers

 avatar  avatar

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.