home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / club100 / pg / pggame / pyrmid.200 < prev    next >
Text File  |  2006-10-19  |  6KB  |  145 lines

  1. PYRMID.200 (c) Copyright 1990
  2.            by Paul Globman
  3.  
  4.  
  5. PYRAMID is a solitaire game often played with a standard deck of cards.  The 
  6. first 28 cards are laid out as shown and the remaining 24 are held in the 
  7. "pack".  The cards available for play are the top card in the pack, the top 
  8. card in the "waste" pile, and cards at the bottom of the pyramid.
  9.  
  10. The LEFT and RIGHT arrow keys allow you to move the "pointer" to the card you 
  11. wish to play.  The UP arrow "tags" the card above the pointer, the DOWN arrow
  12. advances thru the pack.
  13.  
  14. TAGGING
  15. -------
  16. If you tag a King, it is removed.  If you tag any other card, it will display
  17. in reverse video.  If you tag a tagged card, it will become untagged.
  18.  
  19. THE GOAL
  20. --------
  21. The idea is to remove ALL 52 cards as follows:  Tag Kings, and pairs of cards
  22. totaling 13 (Jacks are 11, Queens are 12, Aces are 1).
  23.  
  24. THE PACK
  25. --------
  26. You can only go thru the pack 3 times.  If two adjacent cards in the pack total
  27. 13, they may be removed (if you think those cards will not be needed to clear
  28. the pyramid).
  29.  
  30. NEW GAME
  31. --------
  32. You may abort the current game at any time and begin a new game, or you may
  33. abort the current game and replay it, trying a different strategy.  Use upper
  34. case for a (N)ew game or to (R)eplay current deck.
  35.  
  36.  
  37.  
  38. 0 REM PYRMID.BA (c) 1990 by P.Globman
  39. 1 ES$=CHR$(27):RV$=ES$+"p":NV$=ES$+"q":DIMC(52),D(30),P(24),PY(57):C$="A23456789TJQK":P$="  "+STRING$(2,152)+"  "
  40. 2 FORI=27TO31:B$=B$+CHR$(I):NEXT:B$=B$+"NR":X=VAL(RIGHT$(TIME$,2)):X=RND(-VAL(MID$(TIME$,4,2))*60+X)
  41. 3 GOSUB27:FORI=1TO52:C(I)=I:NEXT:FORI=1TO52:X=52*RND(1)+1:Y=C(I):C(I)=C(X):C(X)=Y:NEXT
  42. 4 RESTORE:T=0:PM=0:K=1:X=49:FORI=1TO7:FORJ=1TOI:READY:PY(Y)=K:D(K)=X+J*4:K=K+1:NEXTJ:X=X+78:NEXTI:D(29)=551
  43. 5 D(30)=555:FORI=1TO24:P(I)=C(28+I):NEXT:GOSUB86
  44. 6 A$=INKEY$:IFA$=""THEN6
  45. 7 A=INSTR(1,B$,A$):IFA=0THEN6
  46. 8 ONAGOTO9,10,12,30,14,3,4
  47. 9 MENU
  48. 10 IFP<>19THENP=P+1:GOSUB91
  49. 11 GOTO6
  50. 12 IFP<>2THENP=P-1:GOSUB91
  51. 13 GOTO6
  52. 14 IFT<>0THEN6
  53. 15 IF(P2=PT)AND(PA=3)THEN6
  54. 16 IFP2=PTTHEN18
  55. 17 PP=PP+1:P1=P1-1:P2=P2+1:GOTO19
  56. 18 PP=1:PA=PA+1:P1=PT:P2=0
  57. 19 GOSUB20:GOTO6
  58. 20 IFP2<>PTTHEN23
  59. 21 PRINT@D(29)+1,"  ":IFP2=0THEN24
  60. 22 GOTO25
  61. 23 X=P(PP)MOD13:PRINT@D(29)+1,MID$(C$,X+1,1);:PRINTCHR$(156+P(PP)MOD4):IFP2<>0THEN25
  62. 24 PRINT@D(30)+1,"  ":GOTO26
  63. 25 X=P(PP-1)MOD13:PRINT@D(30)+1,MID$(C$,X+1,1);:PRINTCHR$(156+P(PP-1)MOD4)
  64. 26 GOSUB90:GOSUB92:RETURN
  65. 27 CLS:FORI=0TO4STEP2:LINE(0+I,0+I)-(239-I,127-I),1,B:NEXT:PRINT@217,"PYRAMID":PRINT@299,"by":PRINT@374,"Paul Globman
  66. 28 PRINT@451,"Copyright (c) 1990":LINE(122,10)-(52,102):LINE(122,10)-(192,102):LINE(52,102)-(192,102)
  67. 29 LINE(122,10)-(203,91):LINE(192,102)-(203,91):RETURN
  68. 30 IF(P=18)OR(P=16)OR(P=15)THEN6
  69. 31 ONPGOSUB1,72,73,74,75,76,77,78,79,80,81,82,83,84,1,1,85,1,85:IFP>15THEN42
  70. 32 READY:IFY=0THEN6
  71. 33 IFPY(Y)=0THEN32
  72. 34 IFPY(Y+7)<>PY(Y+8)THEN6
  73. 35 IFT=0THEN51
  74. 36 IFT=PY(Y)THEN55
  75. 37 IFPM=0THEN40
  76. 38 SM=C(PY(Y))MOD13+Y2:IFSM<>11THENBEEP:GOTO6
  77. 39 GOSUB57:X=15-T:GOSUB58:T=0:PM=0:GOTO6
  78. 40 SM=C(T)MOD13+C(PY(Y))MOD13:IFSM<>11THENBEEP:GOTO6
  79. 41 GOSUB57:Y=Y2:GOSUB57:T=0:GOTO6
  80. 42 IF(P=17)AND(P1=0)THEN6
  81. 43 IF(P=19)AND(P2=0)THEN6
  82. 44 IFT=0THEN53
  83. 45 IFT=15-PTHEN56
  84. 46 IFPM=0THEN49
  85. 47 IFY2+X<>11THENBEEP:GOTO6
  86. 48 X=17:GOSUB58:X=19:GOSUB58:T=0:PM=0:GOTO6
  87. 49 IFC(T)MOD13+X<>11THENBEEP:GOTO6
  88. 50 Y=Y2:GOSUB57:X=P:GOSUB58:T=0:GOTO6
  89. 51 V=C(PY(Y)):Y2=Y:IFVMOD13=12THENGOSUB57:GOTO6
  90. 52 T=PY(Y):X=C(T)MOD13:PRINT@D(T)+1,RV$MID$(C$,X+1,1);:PRINTCHR$(156+C(T)MOD4)NV$:GOTO6
  91. 53 IFX=12THENX=P:GOSUB58:GOTO6
  92. 54 T=15-P:Y2=X:PM=1:PRINT@D(D)+1,RV$MID$(C$,X+1,1);:PRINTCHR$(156+VMOD4)NV$:GOTO6
  93. 55 X=C(T)MOD13:PRINT@D(T)+1,MID$(C$,X+1,1);:PRINTCHR$(156+C(T)MOD4);:T=0:GOTO6
  94. 56 T=0:PRINT@D(D)+1,MID$(C$,X+1,1);:PRINTCHR$(156+VMOD4):PM=0:GOTO6
  95. 57 X=6*(D(PY(Y))MOD40):Z=8*(D(PY(Y))\40)-4:LINE(X,Z)-(X+23,Z+15),0,BF:PY(Y)=0:RETURN
  96. 58 FORI=(PP-(X-17)/2)TO23:P(I)=P(I+1):NEXT:P(I)=0:PT=PT-1:IFX=17THENP1=P1-1
  97. 59 IFX=19THENP2=P2-1:PP=PP-1
  98. 60 GOTO20
  99. 61 S=0:FORI=1TO57:S=S+PY(I):NEXT:S=S+P1+P2:Z=0:IFS=0THEN64
  100. 62 IFPA<>3THENRETURN
  101. 63 X$="  PLEASE TRY AGAIN!":GOTO65
  102. 64 X$="  CONGRATULATIONS!!":GOTO66
  103. 65 PRINT@200,"";:FORI=1TO10:PRINTSPACE$(30):NEXT
  104. 66 LINE(50,72)-(90,72):LINE(70,52)-(20,102):LINE(20,102)-(120,102):LINE(120,102)-(70,52)
  105. 67 LINE(69-Z+1,52-(Z-1)/3)-(50,72),0:LINE(69-Z,52-Z/3)-(50,72),1
  106. 68 LINE(69-Z+1,52-(Z-1)/3)-(89-2*((Z-1)/4),70-1.3*(Z-1)),0:LINE(69-Z,52-Z/3)-(89-2*(Z/4),70-1.3*Z),1
  107. 69 LINE(89-2*((Z-1)/4),70-1.3*(Z-1))-(50,71),0:LINE(89-2*(Z/4),70-1.3*Z)-(50,71):Z=Z+1:IFZ<>7THEN67
  108. 70 FORI=1TOLEN(X$):PRINT@334,RIGHT$(X$,I):FORJ=1TO100:NEXT:NEXT:IFS=0THENPRINT@380," You won on";
  109. 71 RETURN
  110. 72 RESTORE94:RETURN
  111. 73 RESTORE95:RETURN
  112. 74 RESTORE96:RETURN
  113. 75 RESTORE97:RETURN
  114. 76 RESTORE98:RETURN
  115. 77 RESTORE99:RETURN
  116. 78 RESTORE100:RETURN
  117. 79 RESTORE101:RETURN
  118. 80 RESTORE102:RETURN
  119. 81 RESTORE103:RETURN
  120. 82 RESTORE104:RETURN
  121. 83 RESTORE105:RETURN
  122. 84 RESTORE106:RETURN
  123. 85 V=P(PP-(P-17)/2):X=VMOD13:D=29+(P-17)/2:RETURN:END
  124. 86 CLS:P=17:FORI=1TO29:X=C(I)MOD13:PRINT@D(I)+1,MID$(C$,X+1,1);:PRINTCHR$(156+C(I)MOD4):GOSUB88:NEXT:PRINTES$"V";
  125. 87 GOSUB91:PRINT@D(29)-80,24:PRINT@D(30)-80,0
  126. 88 X=(D(I)MOD40)*6:Y=8*(D(I)\40)-4:LINE(X,Y)-(X+23,Y+15),1,B:PRINT@27,"Esc to Quit":PT=24:P1=24:PRINT@67,"R - Replay
  127. 89 PP=1:P2=0:PRINT@107,"N - New Game":PA=1
  128. 90 PRINT@392,"Pass"PA;:RETURN
  129. 91 PRINT@596+P*2,P$:RETURN
  130. 92 PRINT@D(29)-80,ES$"K"P1:PRINT@D(30)-80,P2:IFP1=0THEN61
  131. 93 RETURN:DATA 1,8,9,15,16,17,22,23,24,25:DATA 29,30,31,32,33,36,37,38,39:DATA 40,41,43,44,45,46,47,48,49
  132. 94 DATA 43,0
  133. 95 DATA 36,0
  134. 96 DATA 44,29,0
  135. 97 DATA 37,22,0
  136. 98 DATA 45,30,15,0
  137. 99 DATA 38,23,8,0
  138. 100 DATA 46,31,16,1,0
  139. 101 DATA 39,24,9,0
  140. 102 DATA 47,32,17,0
  141. 103 DATA 40,25,0
  142. 104 DATA 48,33,0
  143. 105 DATA 41,0
  144. 106 DATA 49,0
  145.