Skip to content

seamusm02/project-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project 1 - Build a Game with HTML, CSS and JavaScript

Description

The goal is to move all discs from tower A to tower C in the fewest possible moves. The discs must be moved one at a time, stacking smaller discs on top of larger discs.

Tower of Hanoi

Towers of Hanoi - flatironschool

  • Bronze Plan

    • MVP (Minimum Viable Product): Working game logic and minimal UI
      • Game board starts with three towers and a variable number of discs between 3 and 8 inclusive
      • Discs begin on tower A, stacked in increasing width from bottom to top
      • Player can move a disc to any tower, provided there are no discs on the destination tower, or the top most disc on the destination tower is larger in width than the disc to move
      • When all discs have been moved from tower A to tower C, the game is over
      • Number of moves to achieve a winning game is calculated
      • Number of minimum moves for a given number of discs is calculated
  • Silver Plan

    • Add time-based scoring to MVP, which calculates the duration of a winning game
    • Track scores across games (even if the page is reloaded)
    • Basic UI as shown above, with click-based events to transfer discs between towers
  • Gold Plan

    • Polished UI with animations like the UI shown below

Towers of Hanoi - animated

Features

  • Class-based design
    • Classes for Disc, Tower, and Gameboard
    • Strict Encapsulation - Private properties ONLY! Getters and Setters employed exclusively for the main application's consumption.
    • Extensive error checking with TRY / THROW / CATCH
  • Main js file acts as an entry point into the application and includes all class files
  • JSDoc documentation for the source files located here

Technologies Used

  • JavaScript
  • HTML
  • CSS
  • Google Fonts

Towers of Hanoi - Link to Application on Github Pages

About

Build a Game with HTML, CSS and JavaScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published