Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions scriptred.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,51 @@


def ActRobot(robot):
if robot.GetVirus() > 1000:
robot.DeployVirus(200)
up = robot.investigate_up()
down = robot.investigate_down()
left = robot.investigate_left()
right =robot.investigate_right()
if up == "enemy" and robot.GetVirus() > 1000:
robot.DeployVirus(100)
elif up == "enemy-base":
x,y = robot.GetPosition()



msg = "base" + str(x) + str(y-1)
robot.setSignal(msg)
if robot.GetVirus() > 500:
robot.DeployVirus(500)
if down == "enemy" and robot.GetVirus() > 1000:
robot.DeployVirus(100)
elif down == "enemy-base":
x,y = robot.GetPosition()
if x < 10:
msg_X = '0' + str(x)
else:
msg_x = str(x)
if y+1 < 10:
msg_y = '0' + str(y+1)
else:
msg_y = str(y+1)
msg = "base" + str(x) + str(y+1)
robot.setSignal(msg)
if robot.GetVirus() > 500:
robot.DeployVirus(500)
if right == "enemy" and robot.GetVirus() > 1000:
robot.DeployVirus(100)
elif up == "enemy-base":
x,y = robot.GetPosition()
msg = "base" + str(x) + str(y-1)
robot.setSignal(msg)
if robot.GetVirus() > 500:
robot.DeployVirus(500)



if len(robot.GetCurrentBaseSignal()) >0:


return randint(1,4)


Expand All @@ -15,4 +58,4 @@ def ActBase(base):
if base.GetElixir() > 500:
base.create_robot('')

return
return