Giter VIP home page Giter VIP logo

i4pg / tic-tac-toe Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.06 MB

Simple implementation of the classic game Tic Tac Toe

Home Page: https://i4pg.github.io/tic-tac-toe/

HTML 41.67% JavaScript 57.23% CSS 1.10%
css html html5 javascript js odin odin-project odinproject css3 ecmascript web web-application webdevelopment tic-tac-toe tic-tac-toe-game tictactoe tictactoe-game bulma bulma-css game

tic-tac-toe's Introduction

Tic Tac Toe

This is a simple implementation of the classic game Tic Tac Toe. It is part of the curriculum for The Odin Project's JavaScript course.

Demo

You can play the game online here.

Features

  • Two players can play the game (X and O).
  • Players can take turns marking spaces on a 3x3 grid.
  • The game ends when a player gets three in a row or all spaces are filled without a winner.
  • The winner is displayed at the end of the game.
  • The game keeps running and calculating points.
  • It supports single player so you can play against a computer.
  • The computer uses a simple algorithm that takes all the available moves, then loops twice. First, it tries each move and plays it if it's a winning move; otherwise, it goes to the next move. Second, if there is no winning move, it tries each possible move and plays there if it's preventing the opponent from winning; otherwise, it chooses a random place to play.
  • It has a mobile-first responsive design, using Bulma.io.

Showcase

Here are some screenshots of the Tic Tac Toe game:

Getting Started

Usage

You can play the game online here.

Installation

To run this program locally, you can clone the repository to your local machine using the following command:

git clone https://github.com/i4pg/tic-tac-toe.git

Then open the index.html file in your web browser to start playing the game.

Contributing

Contributions to this project are welcome. To contribute, follow these steps:

  1. Fork this repository.

  2. Create a new branch with your changes:

    git checkout -b my-new-branch
  3. Make your changes and commit them:

    git commit -am 'Add some feature'
  4. Push your changes to your forked repository:

    git push origin my-new-branch
  5. Create a pull request on this repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

tic-tac-toe's People

Contributors

i4pg avatar

Watchers

 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.