Corral.BAS 25 Sep, 2025 Click the gameplay window to enter commands. Each round you can take 1-5 steps towards your horse to catch it. It'll bolt if you cover more than half the distance at once, and may kick if you get within 2 steps. Try not to get kicked. The Listing PRINT TAB(11); "**********************************************************" PRINT TAB(11); "**********************************************************" PRINT TAB(11); "** **" PRINT TAB(11); "** CORRAL **" PRINT TAB(11); "** **" PRINT TAB(11); "** As seen in David Ahl's More BASIC Computer Games **" PRINT TAB(11); "** Converted and refactored by Michael Coorlim **" PRINT TAB(11); "** **" PRINT TAB(11); "**********************************************************" PRINT TAB(11); "**********************************************************" PRINT:PRINT:PRINT DIM A(21) DIM S(2,9) FOR I=1 to 2: FOR J = 0 to 9 Read S(I,J): NEXT J : NEXT I DATA 0,1,2,3,3,2,2,1,0,-1 DATA 1,2,3,4,5,4,3,2,1,0 We initialize here. DIM sets the size of our arrays. The READ statement reads in our DATA, populating S's first two dimensions. input "Do you want instructions?";F$ if lcase$(left$(F$,1))="y" then ? "You're a cowboy, and you need to catch your horse in the corral. Each turn you" ? "can take 1-5 steps towards your horse. If you move more than halfway towards him," ? "he will bolt. He may also bolt when close to the rail." ? ? "And if you get within 2 steps, he may kick... so watch out!" end if ? "When prompted, enter from 1 to 5 for your next move's steps." I've rewritten the instructions to be more concise. INIT: C=1 :REM ## The Cowboy's X position L=1 K=0 : REM ## Kick Counter H=0 :REM ## The Horse's X position N=0 : REM ## Turn Number GOSUB HORSE_MOVES More initialization. These variables will be reset if we play again. if R>5 then Q=-Q H=13+Q: GOSUB HORSE_CLAMP : REM #Set the Horse's positon T=2+P: ? Horse CLAMP makes sure the horse doesn't exit our playfield. RESET_STATUS: B$ = " " POPULATE_A: for J = 1 to 21: A(J)=32: ...
First seen: 2025-09-29 00:30
Last seen: 2025-09-29 10:32