From 575f1b92f534607a4e5851f0f392d32eb6f746ac Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 5 Jul 2011 09:18:27 +0200 Subject: [PATCH] use [] instead of charAt() --- star.js/js/star.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/star.js/js/star.js b/star.js/js/star.js index 4e900ba..f923347 100644 --- a/star.js/js/star.js +++ b/star.js/js/star.js @@ -60,7 +60,7 @@ levels = [ "#################@## x#H## x #### ##x ## function count_gifts( state ) { n = 0; for ( i = 0 ; i < LEVEL_HEIGHT * LEVEL_WIDTH ; i++ ) { - if ( state.board.charAt( i ) == cell.GIFT ) { + if ( state.board[ i ] == cell.GIFT ) { n++; } } @@ -77,7 +77,7 @@ function get_pos( state, actor ) { } 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 ) {