A Rust implementation of an AI player for the Filler game, containerized with Docker for easy testing and development.
Filler is a strategic board game where two players (or AI bots) compete to occupy the maximum territory on a grid. This project contains a Rust-based AI solution that competes against pre-built robot opponents.
Here's an example of a game between Bender and Terminator:
- Docker installed on your system
- Basic knowledge of command line operations
Before building the Docker image, you need to download the required game files:
- Download the
docker_imagefolder as a zip file from: https://assets.01-edu.org/filler/filler.zip - Extract the zip file - it contains:
Dockerfile- Container configurationgame_engine- The game executablemaps/- Game maps (map00, map01, map02)robots/- Pre-built opponent AIs (bender, h2_d2, terminator, wall_e)
- Ensure all files are properly extracted in your project directory
Build the Docker image with the following command:
docker build -t filler .Launch an interactive terminal session inside the container:
docker run -it fillerThe solution directory is automatically mounted and compiled inside the container.
Inside the container, use the game engine to start a match:
# Basic syntax
./game_engine -f <map_file> -p1 <player1> -p2 <player2>Watch two robots compete:
./game_engine -f maps/map01 -p1 robots/bender -p2 robots/terminatorTest your solution against a robot:
./game_engine -f maps/map01 -p1 robots/bender -p2 solution/target/debug/solutionAvailable Maps:
maps/map00maps/map01maps/map02
Available Opponent Robots:
robots/bender- Standard difficultyrobots/terminator- Advanced difficulty⚠️
.
├── Dockerfile # Container configuration
├── README.md # This file
├── maps/ # Game maps
│ ├── map00
│ ├── map01
│ └── map02
├── solution/ # Your Rust AI implementation
│ ├── Cargo.toml
│ ├── Cargo.lock
│ └── src/
│ ├── main.rs # Main game logic
│ └── utils.rs # Helper functions
└── robots/ # Pre-built opponent AIs
Your solution is located in the solution/ directory. The Docker container automatically builds it using:
cargo build --releaseFor development and debugging, you can use:
cargo build # Debug build (faster compilation)- Make changes to the Rust code in
solution/src/ - Rebuild the Docker image
- Run the container and test against different opponents and maps
- Terminator Challenge: The
terminatorrobot is exceptionally strong and represents an advanced challenge. Beating it is optional but demonstrates a highly optimized solution. - The solution uses Rust's standard I/O to communicate with the game engine
- Debug output is written to
output.txtfor troubleshooting
- Analyze the board state carefully before each move
- Consider both offensive and defensive positioning
- Different maps may require different strategies
- Start by consistently beating
benderbefore challengingterminator
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
⭐ Star this repository if you found it helpful! ⭐
Made with ❤️ from 🇸🇳
