home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pggame / gaps.200 next >
Text File  |  2006-10-19  |  5KB  |  108 lines

  1.         GAPS.200 by Paul Globman
  2.            Copyright (c) 1990
  3.         -------------------------
  4. GAPS is a solitaire game often played with a standard deck of cards.  All 52
  5. cards are laid out in 4 rows.  The Aces are removed to form GAPS.  You may fill
  6. in GAPS with other cards, provided it is the same suit as an adjacent card, and
  7. is ordered (higher or lower) to that adjacent card, depending upon whether
  8. you are placing it to the right or left of it.
  9.  
  10. TWO's may be moved to the leftmost box, if it is open.  KINGS may be moved to
  11. the rightmost box, if it is open.  The objective is to get each suit in its
  12. own row, sequentially from TWO to KING (left to right), with the rightmost box
  13. of each row empty, upon completion.  Good luck!!
  14.  
  15. Program Operation
  16. -----------------
  17. Use the ARROW keys to move the pointer.  Use the SPACEBAR to pick up and drop
  18. selected cards.  The selected card displays in reverse video until it is 
  19. placed in a GAP or unselected.  Illegal moves are not accepted.
  20.  
  21. New Game
  22. --------
  23. You may abort the current game at any time and begin a new game, or you may
  24. abort the current game and replay it, trying a different strategy.  Use upper
  25. case for a (N)ew game or to (R)eplay current deck.  ESC will abort to Menu.
  26.  
  27. Other Recreational Programs
  28. ---------------------------
  29. Other "games" I've made available on the M100SIG are:
  30.  
  31.     PUZZLE.200
  32.     PUZZL2.200
  33.     PUZZL4.200
  34.     PYRMID.200
  35.  
  36.     Also see PUZZL3.PRD in DL13
  37.  
  38.  
  39. Enjoy the game... Paul Globman [72227,1661]
  40.  
  41. ------------------------------------------------------------------------------
  42.  
  43. 0 REM GAPS.200 (c) 1990 by Paul Globman
  44. 1 DEFINTA-Z:DIMC(52),D(52):ES$=CHR$(27):RV$=ES$+"p":NV$=ES$+"q":C$="A23456789TJQK":BL$="  ":P$=STRING$(2,152)
  45. 2 FORI=27TO32:B$=B$+CHR$(I):NEXT:B$=B$+"NR":X=VAL(RIGHT$(TIME$,2)):X=RND(-VAL(MID$(TIME$,4,2))*60+X)
  46. 3 FORI=1TO52:C(I)=I:NEXT:CLS:Y=0:GOSUB56:FORI=0TO4STEP2:LINE(0+I,0+I)-(239-I,127-I),1,B:NEXT:PRINT@258,"GAPS
  47. 4 PRINT@339,"by":PRINT@414,"Paul Globman":PRINT@491,"Copyright (c) 1990":FORI=1TO13:D(I)=0:NEXT
  48. 5 I=RND(1)*13+1:IFD(I)<>0THEN5
  49. 6 GOSUB55:PRINT@38+I*3,CD$;:Y=Y+1:D(I)=1:FORI=1TO200:NEXT:IFY<>13THEN5
  50. 7 FORI=1TO52:X=52*RND(1)+1:Y=C(I):C(I)=C(X):C(X)=Y:NEXT:FORI=1TO52:D(I)=C(I):NEXT
  51. 8 PRINTES$"V":CLS:FORJ=1TO4:GOSUB56:NEXT:FORI=1TO52:GOSUB53:GOSUB55:PRINT@PA,CD$:NEXT:P=40:I=P:GOSUB53
  52. 9 PRINT@PA+80,P$:FORI=1TO52:IFC(I)MOD13=0THENGOSUB59
  53. 10 NEXT:H=0
  54. 11 S=0:FORI=13TO52STEP13:S=S+C(I):NEXT:IFS=0THENGOSUB60
  55. 12 A$=INKEY$:IFA$=""THEN12
  56. 13 A=INSTR(1,B$,A$):IFA=0THEN12
  57. 14 ONAGOTO15,19,17,21,23,25,3,16
  58. 15 MENU
  59. 16 FORI=1TO52:C(I)=D(I):NEXT:GOTO8
  60. 17 I=P:GOSUB53:PRINT@PA+80,BL$:P=P-1:IFP=0THENP=52
  61. 18 I=P:GOSUB53:PRINT@PA+80,P$:GOTO11
  62. 19 I=P:GOSUB53:PRINT@PA+80,BL$:P=P+1:IFP=53THENP=1
  63. 20 I=P:GOSUB53:PRINT@PA+80,P$:GOTO11
  64. 21 I=P:GOSUB53:PRINT@PA+80,BL$:P=P-13:IFP<1THENP=P+13
  65. 22 I=P:GOSUB53:PRINT@PA+80,P$:GOTO11
  66. 23 I=P:GOSUB53:PRINT@PA+80,BL$:P=P+13:IFP>52THENP=P-13
  67. 24 I=P:GOSUB53:PRINT@PA+80,P$:GOTO11
  68. 25 IFH<>0THEN28
  69. 26 IFC(P)=0THEN11
  70. 27 H=P:I=P:GOSUB53:GOSUB55:PRINT@PA,RV$CD$NV$:GOTO11
  71. 28 IFH<>PTHEN30
  72. 29 H=0:I=P:GOSUB53:GOSUB55:PRINT@PA,CD$:GOTO11
  73. 30 IFC(P)<>0THENBEEP:GOTO11
  74. 31 IF(C(H)MOD13=1)AND(PMOD13=1)THEN52
  75. 32 IF(C(H)MOD13=12)ANDPMOD13=0THEN52
  76. 33 IFPMOD13<>1THEN38
  77. 34 IFC(P+1)=0THEN51
  78. 35 IFC(H)MOD4<>C(P+1)MOD4THEN51
  79. 36 IFC(H)MOD13<>(C(P+1)MOD13)-1THEN51
  80. 37 GOTO52
  81. 38 IFPMOD13<>0THEN43
  82. 39 IFC(P-1)=0THEN51
  83. 40 IFC(H)MOD4<>C(P-1)MOD4THEN51
  84. 41 IFC(H)MOD13<>(C(P-1)MOD13)+1THEN51
  85. 42 GOTO52
  86. 43 IFC(P-1)=0THEN47
  87. 44 IFC(H)MOD4<>C(P-1)MOD4THEN47
  88. 45 IFC(H)MOD13<>(C(P-1)MOD13)+1THEN47
  89. 46 GOTO52
  90. 47 IFC(P+1)=0THEN51
  91. 48 IFC(H)MOD4<>C(P+1)MOD4THEN51
  92. 49 IFC(H)MOD13<>(C(P+1)MOD13)-1THEN51
  93. 50 GOTO52
  94. 51 BEEP:GOTO11
  95. 52 C(P)=C(H):C(H)=0:I=H:GOSUB53:PRINT@PA,BL$:H=0:I=P:GOSUB53:GOSUB55:PRINT@PA,CD$:GOTO11
  96. 53 J=IMOD13:IFJ=0THENJ=13
  97. 54 PA=((I-1)\13)*160+38+3*J:RETURN
  98. 55 X=C(I)MOD13:CD$=MID$(C$,X+1,1):CD$=CD$+CHR$(156+C(I)MOD4):RETURN
  99. 56 PRINTCHR$(240)CHR$(241);:FORI=1TO12:PRINTCHR$(241)CHR$(243)CHR$(241);:NEXT:PRINTCHR$(241)CHR$(242);
  100. 57 PRINTCHR$(245);:FORI=1TO13:PRINT"  "CHR$(245);:NEXT:PRINTCHR$(246)CHR$(241);:FORI=1TO12
  101. 58 PRINTCHR$(241)CHR$(248)CHR$(241);:NEXT:PRINTCHR$(241)CHR$(247):RETURN
  102. 59 GOSUB53:PRINT@PA,BL$:C(I)=0:RETURN
  103. 60 FORI=1TO40STEP13:FORJ=0TO11:IFC(I+J)MOD13<>J+1THENRETURN
  104. 61 IFJ=0THEN63
  105. 62 IFC(I+J)MOD4<>C(I+J-1)MOD4THENRETURN
  106. 63 NEXTJ:NEXTI:FORI=1TO15:PRINT@280,SPACE$(40):PRINT@292,"CONGRATULATIONS!":NEXT:FORI=1TO3:SOUND4000,4:SOUND1500,25
  107. 64 NEXT:PRINT@600," Play again (y/n)";:A$=INPUT$(1):IFA$="N"ORA$="n"THENMENUELSERUN
  108.