Giter Club home page Giter Club logo

react-tic-tac-toe's Introduction

react-tic-tac-toe

A React implementation of Tic Tac Toe for one or two players.

It uses a Monte Carlo simulation to power the AI in single-player mode.

Demo & Examples

Live demo: negomi.github.io/react-tic-tac-toe

To build the examples locally, run:

npm install
npm start

Then open localhost:8080/webpack-dev-server/ in a browser.

Tests

To run the tests with a watcher, run:

npm test

Then open localhost:8000/webpack-dev-server/test/ in a browser.

Installation

Requires React 0.14

The easiest way to use react-tic-tac-toe is to install it from npm and include it in your own React build process (using Browserify, Webpack, etc).

You can also use the standalone build by including dist/TicTacToe.js or dist/TicTacToe.min.js in your page. If you use this, make sure you have already included React, and that it is available as a global variable.

npm install react-tic-tac-toe --save

Usage

var TicTacToe = require('react-tic-tac-toe');

ReactDOM.render(<TicTacToe width={ 3 } singlePlayer />, document.getElementById('app'));

Properties

Property Type Default Function
singlePlayer boolean false Specify this flag to trigger single-player mode
width number 3 Determines the size of the board

react-tic-tac-toe's People

Contributors

negomi 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.