[Community Puzzle] Duck Hunt

https://www.codingame.com/training/easy/duck-hunt

Send your feedback or ask for help here!

Created by @psychedelic68,validated by @pardouin,@MathisHammel and @Fluxor.
If you have any issues, feel free to ping them.

All tests passed, but not validator 2 - why? You should provide tests for all edge cases, and if tests are passed, validators should be passed too.

Well, validators cannot cover all possible mistakes by users so these things happen.
Set expert mode in options and add this custom validator:
12
8
… … … …
… … … .2.
… … … …
4. .1. . … …
… … … …
… … … …
… . .3 … …
… … … …
… … … …
… … … …
. .1 … . .2 …
… … … …
4. . … … …
… … … …
… … . .3 …
… … … …
(I had to add extra spaces cause the forum won’t let me use more than 3 dots in a row)
Expected output:
3 11 6
1 0 0
4 0 7
2 0 6

Try to find your mistake :slight_smile:

2 Likes

Nice puzzle, not too difficult :slight_smile:
Just wanted to say I found it kind of confusing that the coordinates in the description are written as row-col and not the other way around. Not a big complaint, but it just confused me a little when it said “next position is [5,1]” which made me look in the down left corner and not the up-right.

When you represent a 2-dim array, you tend to display one sub array per line so the sub arrays are naturally considers as the rows of a matrix.
When you give the index of an element you first give the index of the sub array (the “row”), then the index within the sub array (the “column”).

Therefore, in a row/column context, the given order is ALWAYS row, column.
Which is the opposite in a graphical context when you give x then y.

It’s a bit confusing but you get used to it :slight_smile: