Skip to content

tGodson/JavaScript-tic-tac-toe-game

Repository files navigation

JavaScript-tic-tac-toe-game

This is a Tic Tac Toe game you can play in your browser!

Project Specification

  1. Set up your project with a HTML, CSS and Javascript files and get the Git repo all set up.
  2. You’re going to store the gameboard as an array inside of a Gameboard object, so start there! Your players are also going to be stored in objects… and you’re probably going to want an object to control the flow of the game itself.
  3. Set up your HTML and write a JavaScript function that will render the contents of the gameboard array to the webpage (for now you can just manually fill in the array with "X"s and "O"s)
  4. Build the functions that allow players to add marks to a specific spot on the board, and then tie it to the DOM, letting players click on the gameboard to place their marker. Don’t forget the logic that keeps players from playing in spots that are already taken!
  5. Build the logic that checks for when the game is over! Should check for 3-in-a-row and a tie.
  6. Clean up the interface to allow players to put in their names, include a button to start/restart the game and add a display element that congratulates the winning player!
  7. Optional - If you’re feeling ambitious create an AI so that a player can play against the computer!

Built With

  • HTML5
  • CSS
  • Bootstrap
  • Javascript ES6

screenshots

Index Page

screenshot

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

  • npm
  • webpack
  • jest

Setup

  • Clone the repository.
  • cd into js-tic-tac-toe folder
  • Run npm install.
  • Run npm run test from your command line.
  • Run npm run dev to play the game.

Usage

  • Fork/Clone this project to your local machine
  • Open folder in your local enviroment and run these lines of code to get started:
  • Double click on index.html
  • To view in IDE just open project folder in your prefered IDE

Authors

👤 Mark James Kiptubei

👤 Tendongze Godson

🤝 Contributing

Contributions and feature requests are welcome!

Start by:

  • Forking the project
  • Cloning the project to your local machine
  • cd into the project directory
  • Run git checkout -b your-branch-name
  • Make your contributions
  • Push your branch up to your forked repository
  • Open a Pull Request with a detailed description to the development(or master if not available) branch of the original project for a review

Show your support

Give a ⭐️ if you like this project!

Acknowledgments

About

This is a Tic Tac Toe game you can play in your browser!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published