Filler project 1337 [42 cursus]
The goal of this project is to create a player/bot who will compete against other bots/players, in a virtual arena. the games is a similar to tic-tac-toe.
- The virutal machine inputs in turns the state of the board as well as a token to each of the players.
- The players then output the coordinates they chose.
- The game ends when both players can't play anymore.
- The player with most points win.
- The program scores the board, the closer the spot is to the enemy pieces to better it is.
- The program then tries to choose a spot with the best possible score.
- The program rescores the board after every turn. For a spot to be valid, the token must crush at least and at most 1 of the program's own pieces.
Board scoring example:
- This helps the program navigate closer to the enemy wich gives of the effect of the program circling the enemy pieces.
Mid fight example:
The VM (filler_vm), extra players and maps are provided in the folder resources.
- make
will compile ohachim.filler executable, and visualisator (visu_filler) in folder visu. - make re
will recompile ohachim.filler executable. - make bothr
will recompile both visualisator and executable.
Launch:
./filler_vm -f maps/map00 -p1 ./ohachim.filler -p2 players/carli.filler This will launch a battle between ohachim.filler and carli.filler in the smallest map.
Made using sdl2
Requirements:
- brew install sdl2
- brew install sdl2_image
- brew install sdl2_ttf
Runs using output from the launching the vm battle.
./filler_vm -f maps/map00 -p1 ./ohachim.filler -p2 players/carli.filler | visu/filler_visu
P: pause space: resume arrow_up: speed up arrow_down: speed down esc/q: quit
Examples: