

With work and other personal commitments, I could only spend a few hours on the problem.

The contest starts and ends when you are sleeping. Being in New Zealand for the contest from a timezone perspective sucks.I made it to the Gold League, which was one of the goals I had set for myself.This was especially true when I tried to add support for the spells ' Petrificius' and ' Obliviate'. I cannot even stress how helpful it was to go back a version or two because the new logic was performing even worse than a few iterations before. Using source control to keep track of the AI.Working iteratively and using the tools above meant that I could see the impact almost immediately.
#Magus spell listbook code#
#Magus spell listbook download#
From earlier contests, I had a python script to help download the game data, parse it and put it into a text file consumed by my program.I did write some collision code, but it is untried and untested. I was able to simulate a portion of the game except for the collisions.For silver and gold leagues, as soon as I had enough mana, I used an Accio if the snaffle was behind a wizard or a Flippendo if the snaffle was in front of a wizard and was aligned with the goal. I reached the bronze league by just chasing after the closest snaffle and trying to throw it in the opponent's goal. I started with a very simple algorithm that was able to get me into the gold league.This allowed me to quickly tweak my algorithms and throw away pieces of code that I felt were not working. This included classes to encapsulate the Wizards, Snaffle etc. I spent the first day setting up the framework for the game.If you would like a copy of the tool, let me know, and I can make it available. I already had a setup that allowed me to combine multiple files into a single cpp file which codingame requires.The code also allows comparing the ide code with the submitted code. I found another tool on the codingame forums that allowed me to test my ide code against other players without submitting my code. This allowed me to work in Visual Studio, which made for a much faster workflow. Working with the web IDE (especially with C++)is a bit clunky, but on the forums, I found a google chrome plugin that allowed me to sync a local file to the web IDE.I had already participated in a previous contest at codingame, which gave me a base to start from.You can use multiple languages to submit your solution, but I went with C++ for obvious reasons.

For example, in wood 1, Bludgers made their entrance, and you could start casting spells from the Bronze league. Also, as you move to the higher leagues, additional rules might apply. Everyone starts from Wood 2, and depending on how good their bot fares, they move to the higher leagues. To pass each league, you need to beat the boss of that league. You also had a maximum of 100 ms to submit your action before you would timeout and lose. This would be repeated till either 200 turns had passed or as soon as one player has scored more than half of the possible points. Each turn consisted of you reading the world state information from stdin and outputting your action to stdout.

Like all other codingame contests, the game was turn-based. 😊 Preambleįor the contest, you played a game of Quidditch and controlled 2 wizards to score points using a Snaffle (Snitch + Quaffle). If you just want to look at my statistics for this contest, you can just scroll to the bottom but, then you would miss seeing all the things I did wrong. This time around, it was a game of Quidditch from the Harry Potter world and was named Fantastic Bits after the Fantastic Beasts and Where To Find Them Every couple of weeks, there is a contest hosted by the folks at.
