1. Miki Tebeka
  2. ssbd

Commits

Miki Tebeka  committed dd4adef

set_score

  • Participants
  • Parent commits 63c18f2
  • Branches default

Comments (0)

Files changed (1)

File ssbd.js

View file
     }
 }
 
+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());