Giter Club home page Giter Club logo

tic-tac-toe's Introduction

Tic Tac Toe in ReactJS

This is an implementation of the popular Tic Tac Toe game in ReactJS. I have taken the following problem statement

  1. It is a 2 player game (no AI)
  2. The app should ask for players' name first before proceeding
  3. The app should have a leaderboard which updates at the end of every round
  4. The user should have options to reset the score board at any time

Lets quickly walk through the project.

Setup

I have used yeoman generator to scaffold the project. I found this generator to be quite useful.

  • Clone the repo using git clone command
  • Run npm install && bower install
  • Once the above command is successful, run gulp watch
  • To run the test cases, run npm test
  • Run gulp build to generate production code
  • Make sure you have node 0.12.0 and Sass >= 3.4

Features

  • I have Sass to maintain the CSS. To read more about Sass please visit the official page
  • Used Bootstrap for making the site responsive. This game can even be played in devices with a width of 290px and the layout won't break.
  • Though Modernizr - a feature detection library is included, I have not used it much. Will be useful when we want this app to run in older browsers
  • Used Gulp task runner for managing the tasks such as compiling, concatenating files, optimizing resources. You can read more about that here
  • I have used Jest for JavaScript unit testing. It is created and maintained by Facebook team.
  • Thought the tic-tac-toe board consists of a 3x3 layout, I have written the logic in a generic way. Just change the variable MAX_ROWS in app.js to any other number, you will get a nxn tic-tac-toe board.

Future Improvements

  • Unit testing is incomplete. Some more cases need to be added to complete the testing.
  • Reset the game in between
  • Have a proper URL structure using History API

tic-tac-toe's People

Contributors

subramaniashiva avatar

Watchers

James Cloos avatar Princiya Marina Sequeira 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.