;Gladiator Brittany Sandvall 04/12/01 ; ;My program is based off of CIRCLES, which runs in circles, firing if ; the enemy is detected. ;My program, however, runs in circles and if the enemy is detected, the ; robot slows down and if not overheating, it fires two shots. ; If it is too hot, it does not fire. If when scanning, the ; enemy is not detected, it increases its turn rate and keeps ; scanning. #def turn_rate #def heat mov turn_rate, 4 ;set turn rate to 4 deg opo 13 0 ;port 13 - set turret to 0 deg opo 17, 6 ;port 17 - set scan arc to 6 deg ipo 10, ax ;port 10 - get a random number cmp ax, -1 ;is it 0 or higher? ja !turn ;if so, turn xor ax, ax ;ax=0 sub ax, turn_rate ;ax=0-turn_rate mov turn_rate, ax ;turn_rate = ax (turn left) !turn opo 14, turn_rate ;port 14 - turn opo 11, 100 ;port 11 - throttle to 100% ipo 7, ax ;port 7 - scan, ax=range cmp ax, 2000 ;is enemy in range? ja !repeat ;if not then don't fire mov turn_rate, 2 ;set turn rate to 2 deg ipo p_heat, heat ;before firing, get heat cmp heat, 200 ;compare heat to 200 ja !turn ;if too hot - don't fire opo 15 ;port 15 - fire opo 15 ;port 15 - fire !repeat mov turn_rate, 8 ;set turn rate to 8 deg jmp !turn ;repeat loop #END