home *** CD-ROM | disk | FTP | other *** search
/ alphant.com / ftp.alphant.com.zip / ftp.alphant.com / Shells / WB96B32D.ZIP / BINGUESS.WB_ next >
Text File  |  1994-04-02  |  682b  |  28 lines

  1. Message("Think of a number","Any number between 0 and 1023")
  2. start = 0
  3. stop = 1023
  4. for i = 1 to 10
  5.    guess = (start+stop+1) /2
  6.    if AskYesNo("Hmmmm","Is your number smaller than %guess%")
  7.       stop = guess - 1
  8.    else
  9.       start = guess
  10.    endif
  11. next
  12. guess = (start+stop+1) /2
  13. ;
  14. ;
  15.  
  16. if guess==0 || guess==1023 
  17.     Message("Hmmm","%guess% eh?  Testing the limits again I assume")
  18. else
  19.     if guess==13
  20.         Message("Hmmm","%guess% seems rather unlucky to me")
  21.      else
  22.         a = guess mod 2
  23.         if a==0 then Message("Hmmm","Even I can figure %guess%")
  24.                 else Message("Hmmm","It must be %guess%, oddly enough")
  25.      endif
  26. endif
  27.  
  28.