Created
June 4, 2015 21:40
-
-
Save dtryon/cde9df43e3b2e9705156 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var Game = (function () { | |
| var _grid; | |
| var init = function (size) { | |
| _grid = []; | |
| for (var x = size - 1; x >= 0; x--) { | |
| var row = []; | |
| for (var y = size - 1; y >= 0; y--) { | |
| row.push(0); | |
| } | |
| _grid.push(row); | |
| } | |
| } | |
| var grid = function () { | |
| return _grid; | |
| }; | |
| return function(size) { | |
| init(size); | |
| return { | |
| grid: grid | |
| }; | |
| }; | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment