"""
AI Name: Random AI
Strategy:
Move around randomly.
Attack any robot in front.
"""
import random
class AI:
def __init__(self):
#Anything the AI needs to do before the game starts goes here.
pass
def turn(self):
if self.robot.lookInFront() == "bot":
self.robot.attack()
return
else:
random.choice([self.robot.turnLeft,self.robot.turnRight,self.robot.goForth,self.robot.goForth2])()
# random.choice([self.robot.turnLeft,self.robot.turnRight,self.robot.goForth,self.robot.goForth2])()ex1
文章信息与版本
文章信息
- 收录
- 2025年12月12日
- 更新
- 2025年12月12日
- 篇幅
- 约 1 分钟