; Metal Fatigue, Improved version of BusterBrown, John J. Allsopp 07/04/02 ; ; This robot is just a slightly improved version of Buster Brown as it ; is not limited to 32 lines of code. #config weapon=1 #config scanner=3 #config engine=4 #config heatsinks=2 #msg Hey Punk! mov ax, 1 int 3 !begin mov dx, 64 !start opo 11, 100 opo 17, dx ipo 7, fx cmp fx 2000 ja !decide !track ;Someone was found mov bx, dx mov ax @3 add ax 1002 je ax jne ax :1005 sar bx, 1 opo 12, bx cmp dx, 2 jbe !fire shr dx, 1 !fire ipo 2, ax cmp ax 80 ja !dontfire opo 15, @3 ipo 2, ax cmp ax 50 ja !dontfire opo 15, @3 !dontfire ; Set course towards target mov bx, @1 ipo 3, ax add ax, @2 cmp fx 50 jae !turn add ax, 40 !turn add ax 16 and ax, 255 sub ax, bx opo 14, ax je !start jne !start ;Decides what to do if no one found !decide cmp dx 64 jae !flip shl dx 1 je !start jne !start !flip opo 12 128 opo 14 8 je !start jne !start ;Hardcoded firing solutions :1000 shl bx, 1 mov ax, 0 sub ax, bx mov bx, ax jne 1005 je 1005 :1001 mov ax, 0 sub ax, bx mov bx, ax jne 1005 je 1005 :1002 mov bx, 0 jne 1005 je 1005 :1003 ; BX doesn't change jne 1005 je 1005 :1004 shl bx, 1 jne 1005 je 1005