Course Materials




MUSIC 250A / CS377C
Human Computer Interaction Theory and Practice:
Designing New Devices

    Lab #1 hints


    Random number function

    [ note, this requires that you #include timer.h and that you run the command timerInit() before you use this function]

      //picks a pseudo random number between 0 and numRange-1
      u08 randomNum(u08 numRange){
              long time;
              time=timer2GetOverflowCount();
              return(time%numRange);
      }

    Send comments about this page to gurevich@ccrma.stanford.edu
    Last modified: Wed Oct 2 14:10:28 PDT 2002