7 – Playing sequences

Let’s add the code that creates the sequences of sounds.

Class work

Topics for today

Scheduling events

The following examples are from w3schools.com:

Workfiles

Download in class: simon-says.zip

Individual files:

We are starting where we left off last week, on version 1 of Simon Says, i.e., we will use simon_1.html and lib1.js and add functions to it to get to version 2.

v2 – Creating and storing a random sequence of pitches

  1. simon_2.html: the only change is to point to the new js script
     

     
  2. lib2.js: generating and storing the sequence
     

     
  3. Our page so far: simon_2.html