Compucolor.org – Virtual Media

Listing of file='SAL.BAS;01' on disk='vmedia/snakes_and_ladders-sector.ccvf'

1 REM K
10 REM  THIS IS SNAKES AND LADDERS
20 REM  BY GREG HUBBARD
30 REM  V1	16/6/81
40 REM  (C) COPYRIGHT 1981
50 REM
60 GOSUB 20000
70 TM= PEEK (32940)+ PEEK (32941)* 256+ 1
80 POKE TM,50:POKE TM+ 2,15:POKE TM+ 4,0
90 XX= CALL (0)
100 REM  SET VARIABLES
110 T$= "neeoeeeoeeeoeeeoeeeoeeeoeeeoeeeoeeeoeeeo"
120 M$= "a  b   b   b   b   b   b   b   b   b   b"
130 B$= "lmmmmmmmmmm"
140 P= 0:J= 0:A$= ""
150 DIM SQ(100,2)
160 FOR I= 0TO 9:FOR J= 0TO 9
170 SQ(100- I* 10- J,1)= (J+ 1)* 4+ 19
180 SQ(100- I* 10- J,2)= I* 3+ 1
190 NEXT J:NEXT I
200 R= PEEK (33209):IF R= 0THEN 200
210 R= RND (- R)
220 FOR I= 1TO 100:IF RND (1)> 1/ 3THEN SQ(I,0)= I:GOTO 250
230 SQ(I,0)= INT (RND (1)* 100)+ 1
240 IF I< 11AND SQ(I,0)< ITHEN SQ(I,0)= I
250 NEXT I
260 SQ(100,0)= 100
270 P(1,2)= 100:P(2,2)= 109:P(3,2)= 118:P(4,2)= 73
280 FOR I= 1TO 4:PL$(I)= "":NEXT I
500 GOSUB 21000:GOSUB 22000
1000 REM  DRAW BOARD
1010 PLOT 15,6,0,12,27,24,6,17
1020 FOR I= 0TO 9
1030 PLOT 3,23,I* 3:PRINT T$
1040 FOR J= 1TO 2:PLOT 3,23,I* 3+ J:PRINT M$
1050 NEXT J:NEXT I
1060 PLOT 3,23,29:PRINT B$:PLOT 6,20
1070 FOR I= 1TO 100
1080 PLOT 6,20,3,SQ(I,1),SQ(I,2):PRINT I;
1090 IF I< 10THEN PRINT " ";
1100 IF SL$= "Y"AND I> SQ(I,0)THEN PLOT 6,10:PRINT "
|~"
1110 IF SL$= "Y"AND I< SQ(I,0)THEN PLOT 6,17:PRINT "
~|"
1120 IF I/ 10= INT (I/ 10)THEN PLOT 3,23,SQ(I,2),6,17:PRINT "a"
1130 IF I= 100THEN PLOT 3,23,0,6,10:PRINT "    
HOME
    "
1140 NEXT I
1150 P= P+ 1:IF P> NPTHEN P= 1
1160 FOR I= 1TO NP:IF PL$(I)< > ""THEN 1240
1170 NEXT I
1180 POKE 33289,23:PLOT 3,0,0:FOR I= 0TO 68
1190 PLOT 6,INT (RND (1)* 7)+ 1:PRINT "GAME OVER ";:NEXT I
1200 FOR I= 0TO 1000:NEXT :POKE 33289,64:XX= CALL (0)
1210 XX= CALL (0):PLOT 14,3,0,31,6,3:INPUT "DO YOU WISH TO PLAY AGAIN? ";A$
1220 IF LEFT$ (A$,1)= "Y"THEN RUN
1230 PLOT 1
1240 IF PL$(P)= ""THEN 1150
1250 PLOT 3,3,26:PRINT "| ~| ~| ~| ~| ~| ~"
1260 PRINT "                     "
1270 PRINT "   123456":REM

1280 PRINT "                     "
1290 PLOT 27,10,6,15,8:PRINT SPC( 29):PLOT 27,24:PRINT SPC( 23)
2000 REM  START PLAY
2010 W= (RND (1)- .5)/ 10
2020 PLOT 29,6,2,3,8,0:PRINT "WIND ="INT (ABS (W* 200))
2030 IF W> 0THEN PLOT 3,9,1:PRINT "gggg>"
2040 IF W< 0THEN PLOT 3,9,1:PRINT "<gggg"
2050 PLOT 3,0,31,14,6,7:XX= CALL (0)
2060 PRINT "   YOUR THROW, "PL$(P);
2070 PLOT 15,6,15
2100 REM  THROW BALL
2110 KB= 33278:POKE KB,0
2120 FOR I= 10TO 127
2130 PLOT 30,2,0,I,1,I,255
2140 IF PEEK (KB)> 0THEN 2170
2150 PLOT 30,2,0,I,1,I,255
2160 NEXT I:GOTO 2100
2170 IF PEEK (KB)= 69THEN 1210
2175 Y= I:X= 2:V= .75+ W:G= .25
2180 PLOT 6,7,2,X,Y,255
2190 X1= X:Y1= Y
2200 V= V+ 1.01* W:G= 1.1* G
2210 X= X+ V:Y= Y- G
2220 PLOT 2,X1,Y1,255
2230 IF Y< 25OR X< 2OR X= > 44THEN 2250
2240 GOTO 2180
2250 IF X< 6OR X= > 42THEN S= 0:GOTO 2330
2260 IF X= > 6AND X< 12THEN X= 9:Y= 16:S= 1
2270 IF X= > 12AND X< 18THEN X= 15:Y= 16:S= 2
2280 IF X= > 18AND X< 24THEN X= 21:Y= 16:S= 3
2290 IF X= > 24AND X< 30THEN X= 27:Y= 16:S= 4
2300 IF X= > 30AND X< 36THEN X= 33:Y= 16:S= 5
2310 IF X= > 36AND X< 42THEN X= 39:Y= 16:S= 6
2320 PLOT 2,X,Y,255
2330 PLOT 14,3,2,8:PRINT "YOU THREW A"S
2340 XX= CALL (0):FOR I= 0TO 500:NEXT I
2350 IF P(P,0)+ S> 100THEN P(P,0)= 100- (P(P,0)+ S- 100):GOTO 2370
2360 P(P,0)= P(P,0)+ S
2370 FOR I= 1TO NP:IF I= PTHEN 2390
2380 IF P(I,0)= P(P,0)THEN P(P,0)= P(P,0)- 1:GOTO 2370
2390 NEXT I:IF F= 1THEN F= 0:GOTO 3000
2400 IF P(P,0)< = 0THEN P(P,0)= 0:S= 0
2410 IF S= 0THEN PLOT 3,2,12:PRINT "YOU'RE GOING NOWHERE"
2420 IF S> 0THEN PLOT 3,2,12:PRINT "MOVE TO"P(P,0)
2430 XX= CALL (0):FOR I= 0TO 500:NEXT I
3000 REM MOVE PIECE
3010 XX= CALL (0)
3020 IF P(P,0)= 0THEN 3080
3030 IF P(P,1)= 0THEN 3070
3040 PLOT 15,3,SQ(P(P,1),1),SQ(P(P,1),2),6,20:PRINT P(P,1);
3050 IF INT (P(P,1)/ 10)= P(P,1)/ 10THEN PRINT "a"
3060 IF P(P,1)< 10THEN PRINT " "
3070 PLOT 15,3,SQ(P(P,0),1)+ 1,SQ(P(P,0),2),6,P(P,2):PRINT "``"
3080 P(P,1)= P(P,0)
3090 IF P(P,0)= SQ(P(P,0),0)THEN 3610
3100 IF P(P,0)> SQ(P(P,0),0)THEN 3400
3200 REM LADDER
3210 PLOT 6,66,14,3,2,16
3220 PRINT "HEY, HO, LET'S GO!!"
3230 PLOT 15,6,2
3240 PI= 255:D= 10:NS= 253:S1= 255:S2= 0:GOSUB 50000
3250 P(P,0)= SQ(P(P,0),0):F= 1:GOTO 2370
3400 REM SNAKE
3410 PLOT 6,65,14,3,2,16
3420 PRINT "DOOM THREATENS!!   "
3430 PLOT 15,6,2
3440 PI= 40:D= 20:NS= 100:S1= 2:S2= 0:GOSUB 50000
3450 P(P,0)= SQ(P(P,0),0):F= 1:GOTO 2370
3600 REM  FINISH
3610 IF P(P,0)< 100THEN 4000
3615 P(P,0)= 0
3620 PLOT 6,68,14,3,2,16
3630 PRINT "YOU'RE HOME, "LEFT$ (PL$(P),8)
3640 PI= 50:D= 20:NS= 255:S1= 40:S2= 60:GOSUB 50000
3650 PLOT 15,3,23,0,6,10:PRINT "    
HOME
    ":PL$(P)= ""
4000 REM  NEXT PLAYER
4010 FOR I= 0TO 500:NEXT I
4020 PLOT 6,0,14,3,0,31,11,15
4030 FOR I= 0TO 31:PLOT 3,127,0,31- I,0:PRINT SPC( 23):NEXT I
4040 PLOT 15,6,1
4050 GOTO 1150
19999 END
20000 REM TITLE
20010 PLOT 15,6,17,12
20020 PLOT 3,21,4:PRINT "cf  pb  tu  bh  {e  cf"
20030 PLOT 3,21,5:PRINT "gd  as  no  a|  l  gd"
20040 PLOT 3,27,8:PRINT "tu  pb  nu"
20050 PLOT 3,27,9:PRINT "no  as  lw"
20060 PLOT 3,19,12:PRINT "a   tu  nu  nu  {e  {d  cf"
20070 PLOT 3,19,13:PRINT "l  no  lw  lw  l  a|  gd"
20080 REM











20090 L$= "~~y~y~y~y~y~y~y~y~y~y~y~"
20100 REM











20110 S$= "Vaa~~~~bb||bb~~aa||fg|>gcjfg"
20120 REM











20130 PLOT 3,5,27:PRINT L$:PLOT 3,50,27:PRINT S$
20140 PLOT 15,6,2:RETURN
21000 REM  INSTRUCTIONS
21010 XX= CALL (0)
21020 PLOT 3,17,22:INPUT "WOULD YOU LIKE INSTRUCTIONS? ";A$
21030 IF LEFT$ (A$,1)< > "Y"THEN RETURN
21040 PLOT 12,14:PRINT "INSTRUCTIONS"
21050 PRINT :PRINT "THIS GAME IS BASED ON THE TRADITIONAL SNAKES"
21060 PRINT "AND LADDERS BOARD GAME.  UP TO FOUR PEOPLE"
21070 PRINT "CAN PLAY ONE GAME."
21080 PRINT :PRINT "RATHER THAN THROWING A DICE, YOU MUST THROW"
21090 PRINT "A BALL INTO ONE OF SIX BUCKETS.  THE BALL IS THROWN"
21100 PRINT "BY HITTING RETURN AS IT RISES UP A POLE."
21105 PRINT "(DON'T FORGET TO ALLOW FOR THE WIND!!)
21110 PRINT "THE BALL WILL THEN FALL INTO ONE OF THE BUCKETS NUMBERED"
21120 PRINT "ONE TO SIX.  THIS IS THE NUMBER OF SQUARES YOU WILL MOVE."
21130 PRINT "YOUR PIECE WILL THEN BE MOVED TO THE APPROPRIATE SQUARE."
21140 PRINT "IF YOU LAND ON AN OCCUPIED SQUARE, YOU WILL BE MOVED"
21150 PRINT "BACK ONE."
21160 PRINT "IF YOU LAND ON THE BOTTOM OF A LADDER (~|),"
21170 PRINT "YOU WILL MOVE UP TO A HIGHER SQUARE!"
21180 PRINT "IF YOU LAND ON THE HEAD OF A SNAKE (|~),"
21190 PRINT "YOU WILL MOVE DOWN TO A LOWER SQUARE!"
21200 PRINT "NOTE: A LADDER MAY LEAD TO A SNAKE OR A SNAKE MAY"
21210 PRINT "LEAD TO A LADDER, SO BE CAREFUL!"
21220 PRINT "AS YOU APPROACH THE HOME SQUARE, YOU MUST THROW"
21230 PRINT "THE EXACT NUMBER TO GET HOME.  IF YOU OVERSHOOT,"
21240 PRINT "YOU WILL MOVE HOME AND THEN BACK AGAIN.  THIS CAN"
21250 PRINT "BE DANGEROUS IF THERE ARE ANY SNAKES LURKING!"
21260 PRINT :INPUT "HIT RETURN TO COMMENCE PLAY ";A$
21999 RETURN
22000 REM  GET PLAYERS
22010 PLOT 6,3,12,3,20,5
22020 INPUT "ENTER NUMBER OF PLAYERS: ";NP
22030 IF NP> 4THEN 22000
22040 PLOT 3,20,8:PRINT "ENTER NAMES OF PLAYERS -"
22050 FOR I= 1TO NP
22060 PLOT 3,20,8+ I* 3:PRINT "PLAYER"I": ";:INPUT "";PL$(I)
22070 NEXT I
22080 PLOT 3,20,8+ I* 3:INPUT "DO YOU WANT SNAKES AND LADDERS SHOWN? ";SL$
22090 SL$= LEFT$ (SL$,1)
22100 RETURN
50000 REM  SOUND POKER
50010 AD= TM:DA= PI:GOSUB 50060
50020 AD= TM+ 2:DA= D:GOSUB 50060
50030 POKE TM+ 4,NS:POKE TM+ 5,S1:POKE TM+ 6,S2
50040 XX= CALL (0)
50050 RETURN
50060 Z1= INT (DA/ 256):Z2= DA- Z1* 256
50070 POKE AD,Z2:POKE AD+ 1,Z1:RETURN