// Tank 2 subroutine SUB TANK2(X,Y,DIR,X1,Y1,DIR1,CODE) FLAG1=0 FLAG2=0 FLAG3=0 IF FLAG1=0 THEN initialize IF FLAG2=1 THEN leftside IF FLAG3=1 THEN rightside initialize: //Find column, DIM arrays, DATA, set flags DIM LS(101) DIM RS(101) FOR I=1 TO 100 READ LS(I) NEXT I FOR I=1 TO 100 READ RS(I) NEXT I DATA 1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1 DATA 1,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3 DATA 1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1 DATA 1,3,1,1,3,1,1,3,1,1,3,1,1,3,1,1 DATA 3,1,1,3,1,1,3,1,1,3,1,1,3,1,1,3 DATA 1,1,3,1,1,3,1,1,3,1,1,3,1,1,3,1 DATA 1,3,1,1 DATA 1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1 DATA 1,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2 DATA 1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1 DATA 1,2,1,1,2,1,1,2,1,1,2,1,1,2,1,1 DATA 2,1,1,2,1,1,2,1,1,2,1,1,2,1,1,2 DATA 1,1,2,1,1,2,1,1,2,1,1,2,1,1,2,1 DATA 1,2,1,1 IF X=3 THEN FLAG2=1::FLAG1=1::CODE=3:: SUBEXIT IF X=30 THEN FLAG3=1::FLAG1=1::CODE=2:: SUBEXIT leftside: FLAG4=0 IF FLAG4=1 THEN leftexecute IF Y=2 THEN FLAG4=1::CODE=2:: SUBEXIT IF FLAG4=0 THEN CODE=1:: SUBEXIT //Straight to top, set flag4 //If flag4 set, check fire solution, execute array leftexecute: IF X1=0 THEN search IF (ABS(X-X1)<=8 AND Y=Y1) OR (ABS(Y-Y1)<=8 AND X=X1) THEN CODE=4:: SUBEXIT search: I=1 CODE=LS(I) I=I+1 SUBEXIT rightside: FLAG5=0 IF FLAG5=1 THEN rightexecute IF Y=2 THEN FLAG5=1::CODE=3:: SUBEXIT IF FLAG5=0 THEN CODE=1:: SUBEXIT //Straight to top, set flag 5 //If flag5 set, check fire solution, execute array rightexecute: IF X1=0 THEN destroy IF (ABS(X-X1)<=8 AND Y=Y1) OR (ABS(Y-Y1)<=8 AND X=X1) THEN CODE=4:: SUBEXIT destroy: I=1 CODE=RS(I) I=I+1 SUBEXIT //THANK YOU, VORTICON, FOR ORGANIZING THIS COMPETITION! SUBEND // Screen data // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 // 1 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101 // 2 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 3 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 4 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 5 101, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96,101 // 6 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 7 101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 8 101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 // 9 101, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96,101 //10 101, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96,101 //11 101, 96, 96, 96,101, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96,101, 96, 96, 96,101 //12 101, 96, 96, 96,101, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96,101, 96, 96, 96,101 //13 101, 96, 96, 96,101, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96,101, 96, 96, 96,101 //14 101, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96,101 //15 101, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96,101 //16 101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //17 101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //18 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //19 101, 96, 96, 96,101,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101,101, 96, 96, 96,101 //20 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //21 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //22 101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101,101, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,101 //23 101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101,101 //24 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32