Giter Site home page Giter Site logo

tic-tac-toe's Introduction

Tic-Tac-Toe

Installation: Github Pages, or download/clone the repo above.

Technologies

  • HTML5

  • CSS3

  • Vanilla Javascript

  • Tilt.js: A library that makes the tilt animations possible

  • Animate.css: Creates the pulse effect when the win condition is met.

  • Git, Github, Github Pages: Version Control and hosting.

  • VSCode: Code editor, formatted with Prettier.

  • wireframe.css: Website used to create wireframe mockup.

User Stories

  • As a user, I want to be able to be able to play against another user or myself so that I can enjoy the game alone or with friends.

  • As a user, I can click a button to change between AI and player versus player game modes.

  • As a user, I can click a button to reset the board so that I can play another match.

  • As a user, I can click a tile and that tile will turn into either an X or an O depending on whose turn it is so that I can play a full match.

  • As a user, I want to be able to keep track of my score so that I can brag about beating someone in Tic-Tac-Toe.

  • As a user, I want some sort of feedbak that lets me know who won or if there is a tie.

Wireframe

wireframe

Approach

My approach isn't the DRYest method, but it works. I have every combination in a single function which is called each time a user clicks a tile to make sure a win condition has been met or not. If it hasn't, then the function adds 1 to a global turn counter variable. The turn counter is then checked to see if it is even or odd, and based on that an "X" or an "O" is set in that tile.

For my AI, it simply will find a random empty tile and change the inner text to "O" after the user has clicked their tile.

Unsolved Problems

  1. Currently the AI can still be a bit buggy which will need to be fixed.

  2. I have a lot of non-DRY code that code be refactored.

  3. I want to add an impossible AI eventually.

tic-tac-toe's People

Contributors

gatlin-carrier avatar

Watchers

James Cloos avatar  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.