[Community Puzzle] Queen control

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @Akip1,validated by @peerdb,@Aksima and @The_Goat_2000.
If you have any issues, feel free to ping them.

@Akip1,@peerdb
Could anyone help me with test case “White ally down right”?
I’m getting 21 and the expected output is 19, am I double counting some of them?

Controlled cells are marked with an ‘x’

Input

white
........
........
........
.Q.....w
........
.ww.....
........
........

computed output

.x..x..
.x.x...
xxx.....
xQxxxxxw
xxx.....
.wwx....
.x..x...
.x...x..

Hi,

You can’t move over another piece, the Queen doesn’t control the two positions directly below after the other white piece.

.x.x...
xxx.....
xQxxxxxw
xxx.....
.wwx....
....x...
.....x..

I understand now, thanks for clarifying. I’ve resolved it! :slightly_smiling_face:

Bonjour,
Mon programme est bon mais il n’aurait pas dû l’être car il me restait une séquence à écrire pour traiter un dernier cas.
Celui où la reine ne doit pas voir les pièces masquées en diagonale.
C’est un cas qui ne figure pas dans les jeux de test.
Etes-vous d’accord avec moi ?

Hi,
My program is good, but it shouldn’t have been, because I still had a sequence to write to deal with one last case.
The one where the queen must not see the diagonally masked pieces.
This is a case that doesn’t appear in the test games.
Do you agree with me?

Any examples?

1 Like