Created
August 17, 2015 02:19
-
-
Save thenickreynolds/b199471d9ff200fa8199 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 BoggleBoard = function(letters, width, height) { | |
if (letters.length != width * height) throw 'incorrect board length'; | |
this.width = width; | |
this.height = height; | |
this.letters = letters; | |
} | |
BoggleBoard.prototype.at = function(x, y) { | |
return this.letters.charAt(y * this.width + x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment