mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2025-01-14 08:01:19 +01:00
use [] instead of charAt()
This commit is contained in:
parent
5275c5221e
commit
575f1b92f5
1 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ levels = [ "#################@## x#H## x #### ##x ##
|
||||||
function count_gifts( state ) {
|
function count_gifts( state ) {
|
||||||
n = 0;
|
n = 0;
|
||||||
for ( i = 0 ; i < LEVEL_HEIGHT * LEVEL_WIDTH ; i++ ) {
|
for ( i = 0 ; i < LEVEL_HEIGHT * LEVEL_WIDTH ; i++ ) {
|
||||||
if ( state.board.charAt( i ) == cell.GIFT ) {
|
if ( state.board[ i ] == cell.GIFT ) {
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@ function get_pos( state, actor ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_cell( state, x, y ) {
|
function get_cell( state, x, y ) {
|
||||||
return( state.board.charAt( x + ( y * LEVEL_WIDTH ) ) );
|
return state.board[ x + ( y * LEVEL_WIDTH ) ];
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_cell( state, x, y, value ) {
|
function set_cell( state, x, y, value ) {
|
||||||
|
|
Loading…
Reference in a new issue