@@ -16,26 +16,26 @@ var Fixed2DArray = function Fixed2DArray(width,height,defaultValue) {
16
16
} ;
17
17
18
18
/**
19
- * Throws an Error if the given coordinates are invalid
19
+ * Throws an Error if the given coordinate is invalid
20
20
*/
21
21
Fixed2DArray . prototype . validateCoords = function ( x , y ) {
22
22
if ( x < 0 || y < 0 || x >= this . _width || y >= this . _height ) {
23
- throw new Error ( 'fixed-2d-array: the coordinates (' + x + '/' + y + ') ' +
24
- 'are not valid in this Grid .' +
25
- ' The grid size is (' + this . _width + '/' + this . _height + ')' ) ;
23
+ throw new Error ( 'fixed-2d-array: the coordinate (' + x + '/' + y + ') ' +
24
+ 'are not valid.' +
25
+ ' The size of this array is (' + this . _width + '/' + this . _height + ')' ) ;
26
26
}
27
27
} ;
28
28
29
29
/**
30
- * Returns the coresponding value for the coordinates
30
+ * Returns the coresponding value for the coordinate
31
31
*/
32
32
Fixed2DArray . prototype . get = function ( x , y ) {
33
33
this . validateCoords ( x , y ) ;
34
34
return this . _grid [ x ] [ y ] ;
35
35
} ;
36
36
37
37
/**
38
- * Sets the value for the coresponding coorinates
38
+ * Sets the value for the coresponding coorinate
39
39
*/
40
40
Fixed2DArray . prototype . set = function ( x , y , val ) {
41
41
this . validateCoords ( x , y ) ;
@@ -52,7 +52,7 @@ Fixed2DArray.prototype.set = function(x,y,val) {
52
52
* [ ][*][*][*][ ]
53
53
* [ ][ ][ ][ ][ ]
54
54
*
55
- * the given coordinates are marked with an `X`
55
+ * the given coordinate is marked with an `X`
56
56
* the function will return an array containing
57
57
* the values for the fields maked with an `*`
58
58
*/
0 commit comments