home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 349_01 / sss.arc / EX_0301.BAS < prev    next >
BASIC Source File  |  1991-04-09  |  689b  |  43 lines

  1. ' Program EX_0301.BAS
  2. ' Listing 4B - see documentation in TUTOR.SSS
  3.  
  4. const free = 0, busy = 1
  5.  
  6. declare function rnx (m, s)
  7. declare sub prime ()
  8.  
  9. rem $include: 'SSSB.H'
  10.  
  11.   call prime
  12.  
  13.   do
  14.     if RA < .25 then
  15.       SETT T + ER(2, 2)
  16.     else
  17.       SETT T + TR(1, 3, 4)
  18.     end if
  19.     TALLY 1, free
  20.     SETT T + rnx(7, 4)
  21.     TALLY 1, busy
  22.   loop while T <= 120
  23.  
  24.   title$ = "  "
  25.   SUMRY sadd(title$)
  26.  
  27. sub prime
  28.   INIQUE 0, 0, 1
  29.   title$ = "Busy fraction         "
  30.   INISTA 1, sadd(title$), 1, 0, 0, 0
  31.   TALLY 1, free
  32.   SETT rnx(7, 4)
  33.   TALLY 1, busy
  34. end sub
  35.  
  36. function rnx (m, s)
  37.   do
  38.     x = RN(m, s)
  39.   loop while x <= 0!
  40.   rnx = x
  41. end function
  42.  
  43.