Git Product home page Git Product logo

tower-of-hanoi's Introduction

Tower-of-Hanoi

GA Project 1 - Tower of Hanoi

Technologies Used

  • HTML, CSS, JavaScript
  • Brain Grease
  • Coffee

Approach Taken

The setup is based around a combination of classes, objects, and a handful of functions.

The class Disk holds all relevant information about the disk, including color, row number, column number, calculated width, and disc number. The disc number is used to calculate whether disks can be placed on top of each other. The color is determined by an array of pretty colors I preselected on Commuter Creative, a site I recommend for color ideas.

The script itself is a pseudo MVC, with a collection of functions that update row/column assignments and handle placement logic, and a collection of functions that update disc positions on-screen, and other visual elements.

This combination of approaches lead to a pretty slimmed down version of what I was expecting it to be. It can always be optimized, but this Minimum Viable Product works and that's what counts.

Installation Instructions

None to speak of. Simply load index.html and the game will run just fine.

Unsolved problems

The game Tower of Hanoi is used pedagogically to demonstrate the power of recursive algorithms. The general algorithm for solving a game with n-disks is very short, easy to demonstrate, and easier to implement. The goal was to have this as an option, but time constraints coupled with a complete HTML/CSS rewrite, and a subsequent JS rewrite, lead to a lack of implementation.

tower-of-hanoi's People

Contributors

wrylyriley avatar

Stargazers

 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.