Giter Club home page Giter Club logo

tic-tac-toe-javascript's Introduction

Tic Tac Toe Console Game

How to Play

  • Created with Javascript, open the index.html file and then hit OPTION + COMMAND + J to open the console on Mac, or CTRL + SHIFT + J on Windows.

  • Game will automatially load in the console. First player is assigned as X, second player O.

  • The board co-ordinates are provided to you as a guide so players know where they can place their markers.

  • To place a marker, players take in turn typing playerTurn and the position where they would like to go, eg, if they wanted to place their marker on the top left corner, they would type playerTurn(0).

  • After a winner is announced, type resetBoard() to play again.

  • If there is a draw the game board will automatically reset.

  • Players can't put a marker in a square that is already taken by another players marker.

Game Rules

  1. The game is played on a grid that's 3 squares by 3 squares.
  2. Player 1 is X, Player 2 is O. Players take turns putting their marks in empty squares.
  3. The first player to get 3 of their marks in a row (up, down, across, or diagonally) is the winner.
  4. When all 9 squares are full and no player has 3 marks in a row, the game ends in a draw.
  5. Players are able to reset after a player has won, or automatically resets if the game results in a draw.

tic-tac-toe-javascript's People

Contributors

razbag18 avatar

Watchers

James Cloos 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.