marijnh/Eloquent-JavaScript — pull request #113 by jobo3208 (2014-08-20 17:33:12+00:00)
Title: Ch. 16: Allow smaller canvas for smaller level

If a sufficiently small level is used in the canvas version of the game, the program will crash as it attempts to access non-existent squares from the level grid. The small level from Chapter 15, for example, will cause a crash.

This is one simple solution: make the canvas smaller if the level requires it.