Giter Club home page Giter Club logo

tic_tac_toe's Introduction

Tic Tac Toe

Table of Contents

Introduction

Have you always wanted to play tic tac toe with your friend ON THE SAME COMPUTER?? ๐Ÿ’ป Well look no further because this tic tac toe game was made to be played at parties (a party of 2 is still considered a party, yes ๐Ÿ˜œ).

Technologies

  • JavaScript
  • HTML
  • CSS

Set Up

  1. Clone this repository.
  2. cd into the directory.
  3. Run open index.html.

Deployment Link

Features

  • Player can only place a token in an empty space
  • Players take turns after each token placement
  • Player can only win by connecting 3 tokens horizontally, vertically or diagonally

tic tac toe's player2 wins gif

  • Banner indicates player turn and game outcome (win or draw)

tic tac toe's draw gif

  • When a game ends, a new game restarts after 3 seconds
  • Score is maintained after end of each game

tic tac toe's player2 wins gif

  • Player who did not start the current game gets to start the next game

Organizational Resources

Future Features

  • Player can choose their token from a list of tokens
  • When a win occurs, a straight line is shown on the winning sequence
  • When a win occurs, confetti rains on the entire column of the winning player

Reflection

  • This hardest part about this project was creating a win function to work in the console.
  • My initial plan was to have an array for the player which compares their choices to the winning combinations array. In order to make both players be able to do this, I created an array with two player instances inside. Unfortunately, the only way to make the win function work was to have 3 for loops which were nested which took me 9 hours to do (this was explicitly stated to not implement in the rubric).
  • My second attempt was to hard code all the winning positions into the function instead of referring to it in the constructor of the Game instance. This method kind of worked but I had to adjust it. Unfortunately, I still had two separate winning functions and needed to refactor. The refactoring took some time to figure out but made the code very simple!

Contributors

Project Specifications

  • Project specs can be found here.

tic_tac_toe's People

Contributors

irmakerdem avatar

Stargazers

 avatar

Watchers

 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.