Commits

Miki Tebeka  committed dd4adef

set_score

  • Participants
  • Parent commits 63c18f2

Comments (0)

Files changed (1)

     }
 }
 
+function set_score(score) {
+    $('#score').html(score);
+}
+
 function update_score(count) {
     SCORE = SCORE + (count * count);
-    $('#score').html(SCORE);
+    set_score(SCORE);
 }
 
 function initialize_board() {
 }
 
 function restart() {
-    update_score(-SCORE);
+    set_score(0);
     for (var row = 0; row < NUM_ROWS; ++row) {
         for (var col = 0; col < NUM_COLS; ++col) {
             cell_color(row, col, random_color());