Coder Social home page Coder Social logo

celqaz / beatbrutebot Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 168 KB

A simple automation tool to test your robot in different maps and hopefully beat BruteBot for Programming & Algorithm. Thinking Course at Tilburg University.

Python 100.00%

beatbrutebot's Introduction

README.md

A simple automation tool to test your robot in different maps and hopefully beat BruteBot.

Overview

beatBruteBot Overview

Getting Started

Download files

  • 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).
(๐Ÿ’ก 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

Edit Game.py

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

Settings in beatBruteBot.py

Choose your hero

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'

Customize the testing levels

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])

Run the game

In jupyter-lab terminal, run

python beatBruteBot.py

# or

python3 beatBruteBot.py

Good luck!

beatbrutebot's People

Contributors

celqaz avatar

Watchers

 avatar

Forkers

fedecuci

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.