Magic Squares

This is a basic puzzle game in javascript. The objective is to get the grid in a state where only the middle square is not lit by clicking on the squares.

The Game

A javscript simulation of the old Merlin Game from the 80s

Implementation Details

The Game uses javascript and jQuery. The javascript is stored in a module magicSquares.js. The onClick() (well mousedown) event is captured, the internal game state which is held privately in the module is updated, and the squares are redrawn.

The game code is not heavily optimized but for a simple puzzle game it performs quite adequately. On touch devices (iOS in particular), there is a 300ms lag when tapping a square. The browser is waiting to make sure its not a double tap which is a zoom.