Giter Club home page Giter Club logo

tic-tac-toe's Introduction

Tic Tac Toe

Table of Contents

Introduction

This tic-tac-toe game can be played by two human players. Each player has an assigned token, which they will take turns placing inside a box until there is a winning match or a draw. A player can win by connecting 3 tokens horizontally, vertically, or diagonally. The winner will be given points and the game will reset.

This project was assigned as a part of Turing School of Software and Design's Front-End program, students had one week to complete it.

Deployed Page

Visit my site here!

Technologies

  • Javascript
  • HTML
  • CSS
    • Flexbox
    • BEM methodology

Set Up

  1. Fork this repo
  2. Clone the repo to your local machine
  3. View the project in the browser by running open index.html in your terminal

Features

The web page is set up to have a center board and a player on each side. The player has a token and score assigned to them. Each player starts the game with 0 wins. Above the center board, a banner tells the players whose turn it is to place their token. The player can place their token by clicking inside of the box or using the Tab and Enter keys.

The game ends when there is a winner or a draw. If there is a winning match, indicated by the highlighted yellow boxes, the top banner declares the winner and their score will increase. If there is a draw, the top banner declares a draw and the scores remain the same.

The game will restart by clearing the center board and having the second player from the previous game become the first player.

Extension: The players can reset the game by refreshing the page and not worry about losing their score. Local storage is used to save their wins and this data will persist across web refreshes.

Page Demo

Example of button functionality

Possible Future Extensions

  • Give players several tokens to choose from. This makes the game more interactive as it allows players to select their preferred token to play with.
  • Add animation to tokens inside the tic-tac-toe grid that will make them bigger when there is a winning match.

Organizational Resources

Sources

Contributors

Hannah Celemen

Project Specs

  • The project spec & rubric can be found here.

Credits

Icons8 for letting me use their icons for free!

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.