Codingame FantasticBits AI in javascript for an 1 week contest
I managed to finish ~180th global, and top 30th in Gold League with this bot.
Not enough time to use properly the simulation part (but it works !)
The repository is organized with tags.
You can browse them to find the specific commit/code to be promoted to the league.
For example, the BronzeLeague tag contains the AI that can achieve to the bronze league.
- Wizards follow the closest snaffle
- If holding, throw the snaffle to the right goal
- Ally wizards do not target the same snaffle
- Use of Accio on the nearest snaffle of the ally goal
- Detect if a snaffle will enter into a goal
- Use petrificus to prevent a snaffle to enter inside our goal
- No need to move to the closest snaffle if it will goal
- Don't throw the snaffle in goal direction if there is an enemy on it
- Don't use Accio when the snaffle is
- too close or too far from the wizard
- would be pulled away from goal to score
- Use Flipendo on snaffle that will goal
- Simulate next turn with collision
- Encapsulate the state to clone and simulate easily