home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pggame / puzzl2.100 < prev    next >
Text File  |  2006-10-19  |  2KB  |  42 lines

  1. PUZZL2.100 by Paul Globman
  2.            Copyright (c) 1989
  3.  
  4. Here's a little puzzle that I have seen posed as a brain teaser somewhere...
  5. and indeed it is!
  6.  
  7. The rules are simple... the right arrow will rotate the letters clockwise.  The
  8. left arrow will rotate the letters counter-clockwise.  The ESC key will restart
  9. the puzzle from the beginning.  The down arrow will reverse the four letters in
  10. the box. 
  11.  
  12. You start with the letters alphabetized except for 'A' and 'B', which are
  13. reversed.  Your task is to reverse the 'A' and 'B' so all the letters are in
  14. order.  The number in the upper right corner of the LCD counts "moves".  A move
  15. is a reversal of the boxed letters.  Left of right rotation is not counted as a
  16. move.  Can you alphabetize the letters in 50 moves?  How about 30 moves?  How
  17. about 20 moves?   Have fun!!
  18.  
  19. 0 REM PUZZL2.100  Copyright (c) 1989
  20. 1 REM              by Paul Globman
  21. 2 DIML(20):D$="BACDEFGHIJKLMNOPQRST"
  22. 3 CLS:FORI=1TO20:READL(I):GOSUB17:NEXT
  23. 4 FORI=0TO2:GOSUB15:NEXT
  24. 5 FORI=1TO20:PRINT@L(I),MID$(D$,I,1)
  25. 6 NEXT:PRINT@75,C:X$=INKEY$
  26. 7 IFX$=CHR$(27)THENRUN
  27. 8 IFX$=CHR$(29)THENGOSUB20
  28. 9 IFX$=CHR$(28)THENGOSUB21
  29. 10 IFX$=CHR$(31)THENC=C+1:GOSUB22
  30. 11 GOTO5
  31. 12 DATA 54,57,60,63,66,109,151
  32. 13 DATA 231,269,266,263,260,257,254
  33. 14 DATA 251,248,206,126,88,51
  34. 15 LINE(76+I,I)-(150-I,22-I),1,B
  35. 16 RETURN
  36. 17 X1=((L(I)MOD40)*6)-3:X2=X1+10
  37. 18 Y1=((L(I)\40)*8)-4:Y2=Y1+14
  38. 19 LINE(X1,Y1)-(X2,Y2),1,B:RETURN
  39. 20 D$=MID$(D$+D$,2,20):RETURN
  40. 21 D$=MID$(D$+D$,20,20):RETURN
  41. 22 MID$(D$,1,4)=MID$(D$,4,1)+MID$(D$,3,1)+MID$(D$,2,1)+MID$(D$,1,1):RETURN
  42.