summaryrefslogtreecommitdiff
path: root/example-bots/random.py
diff options
context:
space:
mode:
authorCarlo Zancanaro <carlo@zancanaro.id.au>2022-09-25 00:10:13 +1000
committerCarlo Zancanaro <carlo@zancanaro.id.au>2022-09-25 00:38:04 +1000
commit7daa5284f9eddf6d4b4e7838919e80ce25324bb0 (patch)
treeac92d9aa97621b4c314441a4cb7cdcab60b4f85e /example-bots/random.py
parente031af6e5e8324fe4cda66d9597904040b17ca80 (diff)
Lots of changes!HEADmaster
Diffstat (limited to 'example-bots/random.py')
-rw-r--r--example-bots/random.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/example-bots/random.py b/example-bots/random.py
new file mode 100644
index 0000000..e61ff15
--- /dev/null
+++ b/example-bots/random.py
@@ -0,0 +1,11 @@
+import random
+
+def calculate_orders(whoami, state):
+ orders = []
+
+ my_robots = state.robots_by_player[whoami]
+ for robot in my_robots:
+ # Make a random move for each robot
+ orders.append(random.choice('ULDRP'))
+
+ return orders