CORRAL.BAS
A downloadable game
CORRAL
CORRAL is a game program inspired by Harry (short for Aragon), a horse acquired in a rash moment of indulgence for a teen-age daughter. Harry, in his own inimitable style, taught us much about the care, feeding and psychology of the equine species. Some of that hard-won psychology has found its way into CORRAL, which is a one-dimensional simulation of the two- (and almost three-) dimensional problem of catching Harry for anything other than food. The main reason for confining Harry’s alter ego in the computer to only one dimension is simply to conserve paper on hard-copy terminals. Even so, the presentation is very effective on a video display unit.
The corral itself is bounded by a pair of side-rails represented by upper-case I characters separated by 21 spaces. The cowboy C always enters beside the leftmost rail while the horse H is happily mooching somewhere between positions 1 and 1 8 with a bias towards the right. This bias and the various other behavioral peculiarities of the horse are governed by two data matrices (statements 90 and 100) which may be altered to vary the beast’s temperament from wild to docile depending on the data distribution.
If the horse bolts, a check is made (line 450) to ensure that it does not reach a position less than one space away from the cowboy. Occasionally, the horse bolts to a position more advantageous to the cowboy, just as in real life, but usually the opposite is true, particularly when it bolts as a result of an incautious approach by the cowboy. So heed with care the advice for the cowboy not to advance by more than half the separation in any one move except when adjacent to the horse, of course!
The probability that the horse may kick when the cowboy moves close is set by the IF statement at line 500. The cowboy is immobilized for from one to five moves, while the horse canters happily away from the scene of his triumph. If this happens more than a certain (random) number of times the round-up is terminated by the departure of the cowboy in an ambulance.
Occasionally the horse decides to engage in a friendly dance around the cowboy, but remember that random number generators have no soul and the result is often vile treachery as the horse delivers a fatal kick at the very moment when a successful catch seems assured. On the other hand, the skill of an accomplished CORRAL cowboy can result in a catch within three moves with no injuries sustained. You either have it or you have not, as the saying goes. In the latter case the program allows a maximum of 100 moves before relegating the luckless cowboy to cookhouse chores.
Computer freaks with multi-color graphics will no doubt be dissatisfied with such prosaic symbols as H and C for the horse and cowboy. A fully animated CORRAL in living color (with sound effects by a music or speech synthesizer— a talking horse yet!) should not be too difficult to achieve.
Program and description are by Colin Keay
*
1 PRINT TAB(26);"CORRAL" 2 PRINT TAB(20);"CREATIVE COMPUTING" 3 PRINT TAB(18);"MORRISTOWN, NEW JERSEY" 4 PRINT:PRINT:PRINT 10 DIM A(21) 40 DIM S(2,9) 50 FOR I=1 TO 2:FOR J=0 TO 9 55 READ S(I,J):NEXT J:NEXT I 60 DATA 0,1,2,3,3,2,2,1,0,-1 70 DATA 1,2,3,4,5,4,3,2,1,0 100 PRINT " YOU ARE THE COWBOY. GO CATCH YOUR HORSE IN THE CORRAL!" 110 INPUT "DO YOU WANT FULL INSTRUCTIONS";F$ 120 IF LEFT$(F$,1)="N" GOTO 190 130 PRINT "YOU MOVE TOWARD YOUR HORSE 1 TO 5 STEPS AT A TIME." 140 PRINT "IF YOU MORE THAN HALVE THAT SEPARATION HE WILL BOLT!" 150 PRINT "HE MAY ALSO BOLT WHEN HE IS CLOSE TO THE RAIL" 160 PRINT "WHEN YOU COME WITHIN 2 STEPS HE MAY KICK. SO LOOKOUT!!" 180 PRINT 190 PRINT "AFTER `?` TYPE IN DIGIT FROM 1 TO 5 FOR COWBOY`S NEXT MOVE" 200 C=1:L=1:K=0:M=0:N=0:GOSUB 800 220 IF R>5 THEN Q=-Q 225 H=13+Q:GOSUB 810 230 T=2+P:PRINT 300 B$=" " 310 FOR J=1 TO 21:A(J)=32:NEXT J 320 A(C)=67:A(H)=72 330 PRINT N,"I"; 333 FOR J=1 TO 21:PRINT CHR$(A(J));:NEXT J 337 PRINT "I",B$; 370 X=ABS(H-C):L=SGN(H-C) 380 N=N+1:IF K>0 GOTO 640 390 IF N>100 THEN 980 395 INPUT D 400 IF D>0 AND D<6 GOTO 450 420 PRINT "ILLEGAL MOVE. TRY AGAIN",;:GOTO 390 450 E=C+L*D:IF E<1 OR E>21 THEN 420 460 C=E:GOSUB 800 510 G=P:H=H+L*G:GOSUB 810 530 IF X<2*D AND D>1 GOTO 570 540 IF H>1 AND H<20 THEN 600 545 GOSUB 800 550 IF R>2 GOTO 600 555 IF X>7 GOTO 300 570 G=9+2*P:H=H-L*G:L=-L:GOSUB 810 580 IF ABS(H-C)>1 THEN 590 585 H=H-3*L:GOSUB 810 590 B$="BOLTED ":GOTO 310 600 IF ABS(H-C)>2 GOTO 300 605 GOSUB 800 610 IF R>3 GOTO 700 615 GOSUB 800 620 K=P+2:M=M+1:H=H-5*L:GOSUB 810 630 B$="KICKED":GOTO 310 640 IF M>T GOTO 900 650 K=K-1:PRINT:GOSUB 800 670 H=H+L*(P+1):GOSUB 810:GOTO 300 700 IF H=C THEN 930 705 GOTO 300 800 R=INT(10*RND(1)):P=S(1,R):Q=S(2,R):RETURN 810 IF H<1 THEN H=1 820 IF H>21 THEN H=21 830 RETURN 900 PRINT:PRINT "THOSE KICKS LANDED YOU IN THE HOSPITAL!" 910 PRINT " GET WELL SOON!!":GOTO 960 930 FOR J=1 TO 21:A(J)=32:NEXT J:A(C)=35 940 PRINT ,"I"; 943 FOR J=1 TO 21:PRINT CHR$(A(J));:NEXT J 947 PRINT "I" 950 PRINT:PRINT "YIPPEE! NOW SEE IF YOU CAN CATCH HIM IN FEWER MOVES" 960 INPUT "ANOTHER ROUNDUP";F$ 970 IF LEFT$(F$,1)="Y" THEN 200 975 GOTO 999 980 PRINT:PRINT "ENOUGH!! YOU`D DO BETTER AS CAMP COOK!":GOTO 960 999 END
Published | 5 days ago |
Status | Released |
Author | ~vidak |
Genre | Simulation |
Tags | Minimalist, sourcecode, Text based |
Download
Install instructions
~$ brandy -load corral.bas
Leave a comment
Log in with itch.io to leave a comment.