Did you know? Programmers convert coffee to code.

If you like my articles, sponsor me a coffee.

Day 6: Fantastic Bits again

Yesterday I did some Fantastic Bits coding again. Now that I have arrived in the gold league I aim at a good position at the top — and to advance into the legend league which will be very though.

And that’s it. I have no further plans currently because in the top of the legend league there is a lot of AI and my AU (artificial unintelligence) is not the best suited against them thus I want only to arrive at the top league.

What I did yesterday was to use other magic too nut just Flipendo.

I cast Petrificus if one of the snaffles is heading too fast towards my goal line.

I use Accio if the closest snaffle is further from the opponent’s goal line than me.

Well, this sounds very simple but I have worked some hours on the heuristics I use. I have had to re-write my event-loop to prioritise movements like first throw if a wizard has a snaffle, after that use Flipendo on the thrown snaffle. If nothing of these happened then look for a close ball which would qualify itself for Accio. If still no magic cast then look for a fast ball approaching the goal line. At the end, if still no magic cast then move towards the target.

The good thing in being at the bottom of a league is that you don’t get angry if you submit and your results are not as good as expected and you lose positions. You can try things out and get conclusions from the plays against other bots. Sometimes you see a good idea and you try to implement it and this will give you the push towards the next level.

It happened to me too at the contest. I have seen how to use Flipendo to fire the ball to score and added it and I have landed in the gold league. OK, that was the end of my journey too but it was not bad using just one magic.

And the most important thing I have learned: always save my code somewhere because after the contest ends there is no way to retrieve my code — so I have had to start over with my work.

GHajba
 

Senior developer, consultant, author, mentor, apprentice.

I love to share my knowledge and insights what I achieve through my daily work which is not trivial — at least not for me.

Click Here to Leave a Comment Below 0 comments
%d bloggers like this: