JavaScript Graphics

Back to index


Your browser is broken ASSIGNMENT:
Recreate the scoreboard display shown to the right. However, you must be able to quickly change the score on the fly. To do this create an array which contains all ten digits in dot form. For instance, the number three can be represented in an array like this:
  111
  001
  111
  001
  111
The array can be "flattened" into a simple string like this:

  var three="111001111001111";

Inspect the code for the image shown to the left to see how this can be done for one digit. You should create an array with a name like digits which contains ten values. Be prepared to quickly substitute in any score requested by your instructor at the time that your work is checked.