Banana Range bug?

I think there is a bug in the range of the Banana command.

My worm would like to throw a banana a distance of 5 and then the server responds that the cell is too far away.

Here is my debug info with the error:

Me = X:18 Y:1 OppWorm = X:23 Y: 3 Distance = 5
C;39;banana 23 3
GameError - Player 2, worm 3, round 39: Cell (23, 3) is too far away

I am using the euclidean distance when I calculate the cell is 5 away. In this example my worm is in position X:18 Y:1 and I am bombing X:23 Y:3.
Euclid = floor (sqrt(25 + 4))
= floor (5.385165)
= 5

It looks like the server code forgot to floor the result?

See line 16:

fun euclideanDistance(other: Point) = sqrt((x - other.x).pow(2) + (y - other.y).pow(2))
1 Like

Hi @kuifie

You are correct, the validation on the banana command used the euclidean distance function, which returns a decimal value. It should rather follow the same logic as the shooting range function, using the floor of this value (which would make your shot in the debug info a valid banana throw)

You can follow progress here


I keep getting GameError - Cell (11,14) is too far away.
The worms -
enemy worms y,x [[1, 17, 25], [2, 20, 16], [3, 11, 14]]
own worms y,x [[1, 21, 18], [2, 15, 8], [3, 10, 18]]

Command C;32; banana 11 14

Am I missing something?

Hi Thinus

The Banana Command format = Banana X Y

If your worm 3 is your active worm and you are throwing the banana at the Opponent Worm 3, then you need to use Banana 14 11 and not Banana 11 14. You are trying to throw a distance of 8 in your example.


This topic was automatically closed after 28 days. New replies are no longer allowed.