#config armor=3 ; consumes 2 points #config scanner=2 ; gives us 2 points #config engine=1 ; gives us 2 points #config heatsinks=0 ; gives us 1 point #config mines=5 ; consumes 5 points #config weapon=1 ; gives us 2 points #config shield= ; consumes 0 points ; This breaks even. We are heavy and slow, tough and loaded with mines. #def numV opo 20, 450 mov BX 24 ; Set mine detection-radius :1 opo 11, 100 mov dx, bx ; shr dx, 1 ; add dx, 8 ; DX = BX/2 + 8 opo 22, DX ; Lay a mine dec BX ; Each mine will have a smaller radius. :2 ipo 10, numV opo 14, numV ipo 10, numV opo 14,numV opo 11, 100 ipo 22, AX ; Check our mines-remaining cmp ax, 0 ; Do we have any mines left? jgr 1 ; If yes, then lay another one. :3 mov ax, 1 int 3 !begin mov dx, 64 !start opo 11, 80 opo 17, dx ipo 7, fx cmp fx 2000 ja !nobody !gotcha opo 18 mov bx, dx ; BX = DX (dx is the scan width) mpy bx, @3 ; bx = scanwidth*accuracy sar bx, 1 ; bx = scanwidth*accuracy/2 opo 12, bx ; turn turret by that amount. cmp dx 2 jbe !fire shr dx, 1 !fire opo 18 , 1223232334 ipo 2, AX cmp AX 50 jgr !start opo 15, @3 ; Set course towards target mov bx, @1 ; get current desired heading ; (not actual heading) ipo 3, ax ; Get actual heading add ax, @2 ; And add to it our turret offset opo 14, ax ; AX is now our new desired heading. !nobody opo 18, 876837864798648 cmp dx 64 jae !flip shl dx 1 jmp !start !flip ipo 10, numV opo 12 128 opo 14 numV jmp !start