A simple automation tool to test your robot in different maps and hopefully beat BruteBot.
graded_maps.zip
- Download graded_maps.zip
- extract the zip file to get a graded_maps folder
- move the graded_maps folder to the same location of your robot code (i.e. root directory).
beatBruteBot.py
- Download
beatBruteBot.py
- move the
beatBruteBot.py
file to the same location of your robot code (i.e root directory).
- Download
(💡 The file structure may differ)
.
├── Bot.py
├── Bot010101.py
├── BruteBot.py
├── Game.py
├── Map.py
├── RandomBot.py
├── app.py
├── beatBruteBot.py
├── graded_maps
│ ├── 10
│ │ ├── map_10_20_10_1_1_3_10_3_.csv
│ │ ├── map_10_20_1_1_3_3_15_3_.csv
│ │ ├── map_10_30_10_2_1_7_15_5_.csv
│ │ └── map_10_30_2_3_20_3_20_3_.csv
│ ├── 6
│ │ ├── map_6_30_10_3_0_0_0_0_.csv
│ │ ├── map_6_30_1_3_0_0_0_0_.csv
│ │ ├── map_6_30_2_3_0_0_0_0_.csv
│ │ └── map_6_30_5_3_0_0_0_0_.csv
│ ├── 7
│ │ ├── map_7_15_10_1_0_0_0_0_.csv
│ │ ├── map_7_25_1_4_0_0_0_0_.csv
│ │ ├── map_7_30_5_3_0_0_0_0_.csv
│ │ └── map_7_50_50_1_0_0_0_0_.csv
│ ├── 8
│ │ ├── map_8_20_1_3_10_2_0_0_.csv
│ │ ├── map_8_30_1_1_20_1_0_0_.csv
│ │ ├── map_8_30_3_2_5_2_0_0_.csv
│ │ └── map_8_30_5_1_2_5_0_0_.csv
│ └── 9
│ ├── map_9_20_1_1_1_5_1_9_.csv
│ ├── map_9_30_20_1_1_3_10_3_.csv
│ ├── map_9_30_2_3_5_3_5_4_.csv
│ └── map_9_40_1_1_1_3_30_3_.csv
├── logs
In Game.py
, change the following code snippets:
def play(self):
...
if self.energy<=0:
print("game over, " +botName+ " ran out of energy")
elif self.map.remainingStains<=0:
print(botName + " finished the map with a score of ", self.energy)
to:
def play(self):
...
if self.energy<=0:
# print("game over, " +botName+ " ran out of energy")
return 'Game Over'
elif self.map.remainingStains<=0:
# print(botName + " finished the map with a score of ", self.energy)
return self.energy
In beatBruteBot.py
, change the value of the variable CHALLENGER
on the 10th line to your robot name.
# Change this to your robot name
CHALLENGER = 'Bot010101'
At the bottom of the beatBruteBot.py
, you can customized the levels you want to test your robot.
#......
if __name__ == "__main__":
# 1. By default, it will test all the maps in level 6 and level 7
beatBruteBot()
# 2. To test a specific level:
# beatBruteBot([8])
# 2. To test all levels:
# beatBruteBot([6,10])
In jupyter-lab terminal, run
python beatBruteBot.py
# or
python3 beatBruteBot.py
Good luck!