Competing · Robot club · about 14 min
Radio in a game, agreeing roles without talking, and swapping jobs when the score says so.
[1 mark]In a game, who hears your send("striker")?
[1 mark]What does this program print?
team = ["bot-7", "bot-2"]
for me in team:
job = "attack" if me == min(team) else "defend"
print(me, job)[1 mark]What does this program print?
team = ["bot-10", "bot-9"] print(min(team))
[1 mark]Why is a rule like the name that sorts first attacks often better than agreeing by radio?
[1 mark]Your attacker has been taken out. What should the defender do?
[1 mark]In the task, a robot sends attack and then drives to the near base. What is wrong?
attack should be in capitalsSend a message saying which job you are taking, then do it: drive to the base zone that matches. This time the job is attack: send attack, then drive to the far base, up the mat and to the left. (Defending would mean the near base, down and to the right.)
from bugbot import *
connect()
# say what you are doing, then do it
send("attack")Plan your program here, then type it in and press Run.
min(), as above, and send what you chose.messages() gives you for ten seconds, so you can see what a busy game sounds like.