Question: Hello computer science experts, I need you to create a * full * and * complete * Python AI program for a Python battle game
Hello computer science experts, I need you to create a full and complete Python AI program for a Python battle game please do not use ChatGPT to make the program!Here is the context, including the requirements, explanation of required functions, Python Battle game code, and the code for randombot and hunterbot. Please start with the hunterbot code as a base it is the last picture and call the other functions as the requirements ask.
Movement
Did you call all the functions? lookAtSpace is optional
Do any movement functions get called when they shouldn't, eg does your bot try to move forward into a
wall?
Does your bot move appropriately as if a human is controlling it
NonMovement
Did you call at least four of the eight nonmovement functions including the required attack function?
Do any of the functions get called when they shouldn't, eg an ability is called without enough energy or
an attack is called when the enemy is in the wrong spot?
Are the nonmovement abilities used logically and do they vary depending on the situation?
Elegance
Does your code go beyond basic movement and attacking?
Did you add attributes to your own Al class for various reasons?
Did you add in your own extra functions?
Did you write your code like a chess match, ie you anticipate how your opponent will behave?
Al Opponents
Does your code beat randombot?
Does your code beat hunterbot?
Hunterbot:
class AI:
def initself:
self.isFirstTurn True
def turnself:
if self.robot.lookInFront "bot":
self.robot.attack
else:
self.goTowardsselfrobot.locateEnemy
def checkDeltaselfenemyLocation:
myLocation self.robot.position
delta enemyLocation
myLocationenemyLocationmyLocation
return delta
def goTowardsselfenemyLocation:
myLocation self.robot.position
delta enemyLocation
myLocationenemyLocationmyLocation
if absdelta absdelta:
if delta:
targetOrientation #face left
else:
targetOrientation #face right
else:
if delta:
targetOrientation #face up
else:
targetOrientation #face down
if self.robot.rotation targetOrientation:
self.robot.goForth
else:
leftTurnsNeeded selfrobot.rotation
targetOrientation
if leftTurnsNeeded :
self.robot.turnLeft
else:
self.robot.turnRight
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
