home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 12 / CD_ASCQ_12_0294.iso / vrac / pclcjs.zip / SOUNDFN.C < prev    next >
C/C++ Source or Header  |  1992-09-01  |  606b  |  23 lines

  1. /* SOUNDER Library Function Copyright 1991 by Chuck Steenburgh */
  2. /* This function sounds a random series of 1-3 tones.  The number
  3.    of tones actually sounded is returned.                         */
  4.  
  5. #include <bios.h>
  6. #include <stdio.h>
  7.  
  8. int sounder()
  9.  
  10. {
  11.     /* Local variables */
  12.      int number, freq[3], counter, length;
  13.      
  14.      srand(51);
  15.      number = (rand() % 3);
  16.      length = 12 / (number +1);
  17.      for (counter = 0; counter <= number; counter++){
  18.           freq[counter] = 110 + (110 * (rand() % 10));
  19.           sound(freq[counter], length);
  20.      }
  21.      return(number);
  22. }
  23.