Skip to content

mark-angus-git/tictactoe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is built from a React tutorial. The tutorial can be found here: https://reactjs.org/tutorial/tutorial.html

The purpose of this tutorial was to demonstrate the basic functionality of react and how it can be used to created a small simple tic, tac, toe game. The tutorial introduces the concepts of state and how this is managed, it extends this futher through the use of a history tool which allows a player to jump back to previous moves.

It was an interesting tutorial to follow and did well in teaching me the basic concepts of React. I enjoyed then building on this and implementing new features. Some features were more challenging then others to implement but it was a fun and enjoyable experience being able to put what I had learnt in to practise.

The work I have done has added additional features to the base example app such as:

  • Lists the position a move was made at within the moves list.
  • Bolds the currently selected item with in the moves list.
  • Uses 2 loops to create the squares for the board instead of hard coding them.
  • Includes a toggle button which lets the user sort the moves in ascending or descending order
  • When a player wins the squares that make up the winning combination are highlighted in yellow.
  • When all squares are filled and neither player wins a message is displayed that the game is a draw.

Deployment

  1. Clone (gh repo clone mark-angus-git/tictactoe) or download and extract the repo.
  2. To build the app run "npm run build"
  3. In the base directory run "serve -s build" to run the server.
  4. If you don't already have serve, "npm install -g serve" to download and install it
  5. Once running you can access it via localhost:3000 by default

About

A react implementation of Tic Tac Toe

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published