Do you have a check to STRIKE if you cannot move anywhere?
Yes, I do.
I suspect my problem was when more than 1 giant threated me when I move (no WAIT or STRIKE). But Iāve never seen this in a test case. So this wild guess and some extra checks that look more like dirty plugs work for now. It validates 100%.
If I had better possiblities to debug Iād refactor it a lot. But as of now Iām afraid Iāll just break the code if I try.
Well you can check how bad it is since itās published now 
Thanks for your thoughts and help!
Solved it!
My solution is quite simple:
- Strike if all giants are in range or if I donāt have a choice
- Choose move depending on number of giants in range and distance to center of giants (+ donāt stay on same line/column as the first giant to avoid the last edge cases)
My solution is rather simple as well, Iām not even computing centroid.
Just move to position where you get
- As far as possible from closest giant
- As close as possible to farthest giant
- As close as possible to middle of the board
So Iāll simply get farthest and closest giant (relative to thor) as close as possible to each other
This solution is as bad as solutions of others, because you canāt exactly predict movements of giants.
Ah, got it at last. Very satisfying. 
The observation that helped me solve the āqueuedā cases is that the giants will naturally clump up, you just have to give them the opportunity to do so! I had Thor walk over to the nearest giant and lead it on a merry chase until Thor was trapped or all giants were in range.
Without giving away too much (I hope): if the giants are clumped along axis a, lead them along axis b.
how do you get the position of the monsters
Their positions are given to you every turn.
Hi there,
I do an emergency strike if there is an intersection between the set of giantās positions and thors (8-fields) neighbourhood, but this usually doesnāt save him.
Does anybody has an idea why ?
Just for the last caseā¦
count = 0
while True:
if count < 11:
print("E")
count += 1
elif count < 18:
print("SE")
count += 1
else:
print("STRIKE")
Fought with this for a good while, but finally got it. The discussion here was very helpful.
My solution was basically:
Check what moves donāt get Thor too close to any giants.
Check what moves brings the most amount of giants closer to Thor.
Pick the move that doesnāt get Thor too close to any giants, but closer to most possible giants, while not moving out of the playing field.
If there are several moves that are equally good pick the one that goes closest to the center.
If already at the center just take the first ābestā move.
And if unable to find a valid move then strike.
Queuing, 1 strike is very hard
If anyone is having trouble with the last test and already tried everything described here, make sure youāre using the Chebyshev distance, not Manhattan or Cartesian.
Not sure if those are the exact values, yet it seems that PI20/3 (27°) and PI20/7 (63°) are more accurate thresholds. I certainly found 28.x° to be in the ādiagonalā category.
So important. I donāt understand why the documentation hasnāt been updated yet, since itās clearly wrong.
my solution
barycenter
and if an ennemy closest.
move on the new position the closest calculated barycenter and if 2 choice take the closest half axis.
hi guys. I also need some help with the last testcase⦠fiddled around the last days. I think I understand whats the problem is for me but I also have some minor clues how i maybe can solve it. after a long time where I started to dip my feed into coding. I did some smaller simpler tools for my work, for which no āheavyā algorithms were needed. But now I want more ![]()
So what I did in my programm: calculating the distance in turns fo each giant. Than add up all the distances and use this as score. than āpredictā the score of each possible āsave moveā without to move the giants (save move is defined, a move in which the smalest distance is biger than 1). I only strike if all giants are in range or there is no save move. this works great for all test cases except the last one. I tried to solve this without predicting the giants move, but it looks like to me this is not possible. I find it hard to predict the movement of the giants. I also refusing to hard code the solution for the last case because i want to understand and train my problem solving skills. so I am seeking more for a hint. What I will try now after reading here, to only predict one or two moves because the giants move a bit strange to me. so the error do not get that big. Is there a way you normaly do your decision how many steps you predict? is it a āas less as possbile but as much as neededā approach?
Sorry for my sometimes a bit crappy english, but I hope it is still understandable
I like this puzzle. Very happy to finally solve it after some days of coding. Iām surprised it has so low success rate, even being an old puzzle with a lot of people attempted to solve it.