Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Chris27,validated by @N3l,@EnjoyLife and @TBali.
If you have any issues, feel free to ping them.
Coding Games and Programming Challenges to Code Better
Send your feedback or ask for help here!
Created by @Chris27,validated by @N3l,@EnjoyLife and @TBali.
If you have any issues, feel free to ping them.
I found the description about the first line of input confusing. At first I thought the knight was always going to be the second character in that list or an ‘N’. Not so.
Thank you for your feedback. I hope you had nevertheless fun solving it.
First an important clarification for everyone else trying to solve it: The puzzle does not assume any specific encoding for the pieces neither regarding letters used nor their order). The goal of the game is to identify which piece moves and detect a specific movement pattern. But it does not require any verification of the validity of the move nor predefined knowledge on the mapping of the letters. The only thing for sure is that there is at least one piece (the minimalistic chess configuration requires a king on each side, so 1 letter appearing in upper and lower case on the board).
Typical chess encodings use 6 letters. For example in English K, Q, B, N, R, P (King, Queen, Bishop, kNight, Rook and Pawn). But the letters depend ont the language (in France they use R, D, F, C, T, P - Roi Dame Fou Cavalier Tour Pion). Nothing prevents less pieces (because not all the pieces might remain on the input boards). Nothing prevents the use of a more fine graded encoding (Since each side has 16 pieces at the start, one could imagine at most 16 different letters). The difficulty here is to consider only the letters that need to be tracked, and to ignore the noise that might be caused by irrelevant letters.
Regarding the confusing description that lead you to think the knight would always comeq second, can you help me ? Is it the sentence “A string pieces containing the uppercase letters (A-Z) that represent the white pieces. (The corresponding lowercase letters represent the black pieces.)” ? Or is it another sentence ? Or did you get the narrative in another language than English ?
Thanks for your answer and the very clear explanation. I think my confusion was caused mostly by the example that was given which caused me to make a false assumption. Also my own ignorance about chess encodings (in different languages) didn’t help. It became clear when figuring out why some test cases failed. Perhaps if I was given the example about the French chess encoding in the description I would have understood it earlier. Nevertheless, I liked your puzzle and learned something new again. Thank you.