Spring Challenge 2021 - Bugs & Questions

Hello m’lads :slight_smile:

I believe there’s a slight inaccuracy in the statement of the contest that ought to be fixed. The instructions say (emphasis mine):

SEED: Command a tree to eject a seed onto a cell within distance equal to the tree’s size.

However, in the source code of the game we find (@SpringChallenge2021/src/main/java/com/codingame/game/Game.java at main · CodinGame/SpringChallenge2021 · GitHub, lines 499-502):

int distance = sourceCoord.distanceTo(targetCoord);
if (distance > sourceTree.getSize()) {
    throw new TreeTooFarException(sourceCell.getIndex(), targetCell.getIndex());
}

So it would seem than an error is triggered only if the distance exceeds the source tree size. In other words, a distance less than or equal to the source tree’s size is admissible.

EDIT (a few minutes later after the post): Sorry :frowning:, I realize now that the instructions say “within a distance”, “within” being a key word here as it implies that any distance equal or lower is admissible. Since English is not my main language, I didn’t pick up the subtlety. Still, a less subtle wording may be clearer for other people.

2 Likes