0% found this document useful (0 votes)
38 views2 pages

Super Sheepdog

This document contains the code for a sheepdog trial game. The game uses graphics to display a field with sheep and a sheepdog. The player uses keyboard inputs to move the sheepdog and herd the sheep by getting close to them. After each successful move, the number of moves is displayed. When all sheep are herded or the move count reaches a threshold, a message is displayed based on performance and the player is asked if they want to play again.

Uploaded by

ross.jm.fuller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views2 pages

Super Sheepdog

This document contains the code for a sheepdog trial game. The game uses graphics to display a field with sheep and a sheepdog. The player uses keyboard inputs to move the sheepdog and herd the sheep by getting close to them. After each successful move, the number of moves is displayed. When all sheep are herded or the move count reaches a threshold, a message is displayed based on performance and the player is asked if they want to play again.

Uploaded by

ross.jm.fuller
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

10 REM Sheepdog Trial

20 *FX 4,1
30 MODE 1
40 VDU 23,224,&00,&00,&7A,&FF,&7D,&78,&48,&48
50 VDU 23,225,&00,&00,&06,&7B,&78,&84,&42,&00
60 VDU 19,0,2,0,0,0
70 VDU 19,3,0,0,0,0
80 VDU 19,1,7,0,0,0
90 DIM Y(5)
100 DIM X(5)
110 M=0
120 FOR X=0 TO 15
130 PRINT TAB(X,16);"#"
140 NEXT
150 FOR Y=0 TO 16
160 PRINT TAB(16,Y);"#"
170 NEXT
180 FOR Y=0 TO 20
190 PRINT TAB(0,Y);"#";TAB(31,Y);"#"
200 NEXT
210 FOR X=0 TO 31
220 PRINT TAB(X,0);"#"TAB(X,21);"#"
230 NEXT
240 FOR Y=1 TO 3
250 PRINT TAB(12,Y);"#"
260 NEXT
270 COLOUR 1
280 FOR S=1 TO 5
290 Y(S)=5+RND(10)
300 X(S)=4+RND(6)
310 PRINT TAB(X(S),Y(S));CHR$(224)
320 NEXT S
330 COLOUR 3
340 YD=1+RND(3)
350 XD=1+RND(3)
360 PRINT TAB(XD,YD);CHR$(225)
370 COLOUR 3
380 *FX 15,1
390 D=INKEY(0)
400 IF D=-1 THEN GOTO 390
410 IF XD=12 AND YD=4 AND D=&8B THEN GOTO 390
420 IF XD=11 AND YD<4 AND D=&89 THEN GOTO 390
430 IF XD=13 AND YD<4 AND D=&88 THEN GOTO 390
440 PRINT TAB(XD,YD);" "
450 IF D=&88 AND XD>1 THEN XD=XD-1
460 IF D=&89 AND XD<15 THEN XD=XD+1
470 IF D=&8A AND YD<15 THEN YD=YD+1
480 IF D=&8B AND YD>1 THEN YD=YD-1
490 PRINT TAB(XD,YD);CHR$(225)
500 M=M+1
510 PRINT TAB(20,10);"MOVE ";M
520 GOSUB 550
530 IF F=0 THEN GOTO 840
540 GOTO 370
550 F=0
560 COLOUR 1
570 FOR S=1 TO 5
580 Y=Y(S)
590 X=X(S)
600 IF (ABS(X(S)-XD)<2 AND ABS(Y(S)-YD)<2) THEN GOSUB 990
610 IF RND(1)<.01 THEN GOSUB 990
620 IF ABS(X(S)-XD)>2+RND(2) THEN GOTO 780
630 IF ABS(Y(S)-YD)>2+RND(2) THEN GOTO 780
640 X(S)=X(S)+SGN(X(S)-XD)
650 Y(S)=Y(S)+SGN(Y(S)-YD)
660 IF X(S)<13 AND X(S)>11 AND Y(S)<4 THEN X(S)=X
670 FS=0
680 FOR Z=1 TO 5
690 IF Z=S THEN GOTO 710
700 IF (X(S)=X(Z)) AND (Y(S)=Y(Z)) THEN FS=1
710 NEXT Z
720 IF FS=1 THEN GOTO 640
730 IF X(S)=XD AND Y(S)=YD THEN GOTO 640
740 IF X(S)<1 THEN X(S)=1
750 IF X(S)>15 THEN X(S)=15
760 IF Y(S)<1 THEN Y(S)=1
770 IF Y(S)>15 THEN Y(S)=15
780 PRINT TAB(X,Y);" "
790 PRINT TAB(X(S),Y(S));CHR$(224)
800 IF X(S)>12 AND (Y(S)>0 AND Y(S)<4) THEN GOTO 820
810 F=1
820 NEXT S
830 RETURN
840 REM ENDGAME
850 COLOUR 1
860 PRINT TAB(2,22);
870 IF M<40 THEN PRINT "SUPER SHEPHERD!!":GOTO 920
880 IF M<60 THEN PRINT "GOOD DOG!!":GOTO 920
890 IF M<90 THEN PRINT "KEEP PRACTISING":GOTO 920
900 IF M<120 THEN PRINT "BETTER LUCK NEXT TIME":GOTO 920
910 PRINT "HAND IN YOUR CROOK !!"
920 PRINT TAB(2,23);"YOU TOOK ";M;" MOVES"
930 INPUT "ANOTHER GAME Y/N ",A$
940 A$=LEFT$(A$,1)
950 IF A$="Y" THEN RUN
960 *FX 4,0
970 VDU 20
980 END

990 XT=X(S):YT=Y(S)
1000 X(S)=X(S)+(SGN(RND(1)-.5)*(2+RND(2)))
1010 IF X(S)<1 THEN X(S)=1
1020 IF X(S)>15 THEN X(S)=15
1030 Y(S)=Y(S)+(SGN(RND(1)-.5)*(2+RND(2)))
1040 IF Y(S)<1 THEN Y(S)=1
1050 IF Y(S)>15 THEN Y(S)=15
1060 IF X(S)=12 AND Y(S)<4 THEN GOTO 1000
1070 IF XT=X(S) AND YT=Y(S) THEN GOTO 1000
1080 RETURN

You might also like