S 0 100000! === SHEEPDOG TRIAL ==='P by R. C. Merry 18/9/1979|( A modified version of the program2 in Practical Computing (March 1980),< written for NAS-SYS 1 & 8K BASICF by L. N. Rodrigues.P#Z 3200,25311: 3202,312: 3204,18351Ld 3206,10927: 3208,8179: 3210,233\n 4100,3200xx === Instructions ===: 16)"Sheepdog Trial" 16)"":" The object of the game  is to drive"" a number of sheep("(169)") into a pen using"V" a sheepdog("(185)"). The sheep tend to wander"" around at random, unless the dog comes"" close, when it can control the sheep"" to an extent. Don't% go too close though"" or the sheep might panic and go off in"P" a random direction. Neither sheep nor"p" dog can jump fences.":" Press any key to continue:": 1200:" You can move the dog by using one of" " four keys: Cursor(^)"" Cursor( )"3" Cursor( )"]"" Cursor( )": 2336,13," Any other key uses up one of your"6" three moves, but doesn't move the"@" dog. After your th ree moves, the sheep"J" move and then you can move again. The"LT" sheep must enter the pen by moving"~^" directly downwards through the gate on"h" the top edge."r:" Press any key to continue:": 1200|:" Once1 you have all the sheep in the pen")" you must keep them there by putting"O" the dog across the gate:":o" "" "" "" ":" You can try to round up and pen up to"1" six sheep. How many do you want";NSB NS7 500N: 5,6z"Don't be greedy! No more than": 460:" Press any key to start:": 1200 === Initialize === XS(6),YS(6),BT(6) I1 6:BT(I)1000000: === Print Pen ===%&: 22,6:" "S0 21)" ": 21)" ": 21)""m: 2058,214: 2890,201D I2059 2103: I,210: I832,201:N 2104,242: 2936,201X I2122 2826 64: I,199: I46,248:b === Generate Sheep === l I1 NS.vX((1)452):Y((1)122)M (1993X64Y)32 630vXS(I)X:YS(I)Y: XS(I),YS(I):"": === Place Dog ===X((1)452):Y((1)122) (1993X64Y)32 670XDfX:YDY: XD,YD:"" === Start === I1 3: 1200#XXD:YYD7 R19 YYD1K R17 XXD1_ R18 XXD1s R20 YYD1 (1993X64Y)32 XXD:YYD  XD,YD:" "XDX:YDY: XD,YD:"":  === Move Sheep ===*TT1: I1 NS 4XXS(I):YYS(I)3> (XS(I)XD)3 (YS(I)YD)3 900]H (XS(I)XD)2 (YS(I)YD)2 900xR XS(I)XD XXS(I)1\ XS(I)XD XXS(I)1f YS(I)YD YYS(I)1p YS(I)YD YYS(I)1z 910 #XXS(I)1((1)3):YYS(I)1((1)3)+ (1993X64Y)32 XXS(I):YYS(I)B XS(I),YS(I):" "iXS(I)X:YS(I)Y: XS(I),YS(I):""o === Are all Sheep in the Pen ? ===P0 I2464 2466 (I)169 PP1 (IR64)169 PP1 PNS 1030 710, === Is Dog by Entrance ? ===E (2401)185 1060O 710o$ === End Game Routine ===y. 3,28"You rounded up"NS"sheep in"T"manoeuvres."B TBT(NS) BT(NS)TL 3,4V"Your best manoeuvre count for"NS"sheep is"BT(NS)` I1 5000:#j: 5,6Tt"Do you want another game (Y or N):": 1200g~ R89 1220:" How many sheep";NS:" Press any key to start:" 1200: 540 === Wait for Key Subroutine ===R(0): R0 1200  : 5,27 "Your best manoeuvre counts were:":X  I1 6: 10)I"sheep - ";  BT(I)1000000 " No manoeuvres": 1270  BT(I)"manoeuvres" : 1,14:=