home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a075 / 1.img / TOOLKIT1.EXE / SST156.PRG < prev    next >
Encoding:
Text File  |  1989-08-09  |  663 b   |  33 lines

  1. ********************
  2.  
  3. FUNCTION Randomize
  4.  
  5.    PARAMETERS _random
  6.  
  7.    IF PCOUNT() = 0
  8.       RETURN(0)
  9.    ELSEIF TYPE("_random") != "N"
  10.       RETURN(0)
  11.    ENDIF
  12.  
  13.    PRIVATE _neg, _random, _ttl, _tts, _rett
  14.  
  15.    _neg = (_random < 0)
  16.  
  17.    IF _random = 0
  18.       RETURN(0)
  19.    ENDIF
  20.  
  21.    _random = ABS(_random)
  22.  
  23.    _ttl  = (SECONDS()/100 - INT(SECONDS()/100)) * 100 * ;
  24.            (LOG(SQRT(SECONDS()/100)) - ;
  25.            INT(LOG(SQRT(SECONDS()/100)))) * 100
  26.    _tts  = _random * (_ttl - INT(_ttl))
  27.    _rett = INT(ROUND(_tts, 2)) + IF(INT(ROUND(_tts, 2)) + ;
  28.            1 < _random+1, 1, 0)
  29.  
  30.    RETURN(_rett * IF(_neg, -1, 1))
  31.  
  32. * End of File
  33.