Code Monkey home page Code Monkey logo

tictactoe's Introduction

2108 FE Final Solo Project -- Tic Tac Toe

Abstract

The goal of this project was to build a functional attractive game of tic tac toe from the ground up. We were provided a very basic layout to match, but otherwise given free reign in the design of the game. The game needed to be playable, to detect wins and draws, and to keep track of each player's wins so that they persist when the page is refreshed. I chose to implement an extra layer of game structure, so that the users are competing in a tournament. The first player to win three rounds wins the tournament, and then they are presented with a button to reload the page for a new tournament.

Creator

August Reid

Technologies

  • Javascript
  • HTML
  • CSS
  • Atom

Project Spec

Instructions and rubric for this project can be found HERE

Wins

I really enjoyed this challenge. The process of making a functional data model before connecting it to the DOM was very helpful. I actually finished with a fully functional game a day early, which gave me time to dome refactoring. I also decided to use that extra time to implement a tournament style game, which included additional win tracking and a refresh button.

Challenges

My code got very messy and ham-fisted. Definitely not fully SRP and DRY. And I did end up with a few global variables. After meeting with my mentor, I had a list of things to work on and ideas for how to refactor for much cleaner code. I chose to implement some of those suggestions, but there were some that would require a serious overhaul of my data model and approach. I would love to start over from scratch with the knowledge I have now.

User Instructions

When the page loads, you will see a blank tic tac toe board, with side panels containing win data for Player 1 and Player 2. Each player has an emoji token -- a honeybee or sunflower. The header above the board displays who's turn it is.

Screen Shot 2021-09-28 at 4 52 49 PM

To take a turn, click on your chosen square, and it will be filled with your emoji token.

Screen Shot 2021-09-28 at 4 53 40 PM

If a player gets three tokens in a row horizontally, vertically, or diagonally, they win! The board header will declare the winner before clearing the board for the next round. If the board is filled without either player achieving three in a row, a draw is declared.

The rounds counter for each player keeps track of wins.

Screen Shot 2021-09-28 at 4 54 28 PM

When one player wins three rounds, they are declared tournament champion, and their wins data will be updated. A button will appear, which the user clicks to start a new tournament. Clicking this button will reload the page, clearing the rounds win data for each player back to zero. However, the tournament wins count will persist on refresh.

Screen Shot 2021-09-28 at 4 55 16 PM

Screen Shot 2021-09-28 at 4 51 26 PM

tictactoe's People

Contributors

augustreid avatar

Watchers

Nathaniel M (He/Him) avatar  avatar

tictactoe's Issues

Description / User Instructions for Tournament and Rounds

As a user, when I start a game, I want to understand how the game structure works. It looks like there the first player to win three "rounds" wins a tournament, but this is not described at any point during game play.

I would love to see brief instructions / description of gameplay on page load.

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.