A strange noise, like a mechanical whine, is heard… You jump for joy: you've managed to reactivate the robot! Its little red eyes start to flash and a series of letters appears on its belly screen: NCS WPNC DE HWP.
What on earth does that mean? Your thoughts are interrupted by a high-pitched beep: your new friend seems to be running on battery power. You barely have time to copy these mysterious characters before it switches off again, obviously completely discharged. You look at each other in amazement. Where could this little android have come from and, above all, who could have built it? Could this new, seemingly incomprehensible code lead you to the beginnings of an answer?
4 letters come up most often: NSEW
These are the 4 cardinal points: North, South, East and West.
This is the history of the robot's movements displayed on the screen. Knowing that the robot and our heroes are currently in the zone defined by positionX and positionY, we should be able to find the robot's starting point by retracing its history in reverse.
A few details:
You need to return the robot's initial position, in the form X_Y, for example ‘3_5’ or ‘-2_17’.
challenge code for resolution via API: GREENOID_2
Some resources to help you:
Data and algorithmic logic Methodologies Corrections
Progress through challenges using our resolution aids: tools, techniques and advice to help you overcome the most complex programming challenges with methodology, confidence and creativity.
Dataset and algorithmic logic
Based on the data and the expected response, use the process to determine the logic to implement.
Show data and progressDevelop a structured approach with our solving guides. Work on specific concepts such as object-oriented programming or unit testing to improve your coding style and progress.
No methodology yet for this challenge, but we are working on it! Follow us to be informed of the release!
The corrections allow you to discover certain technical concepts but will also give you a solution to the challenge. Code the challenge yourself before consulting the corrections ;)
Programming concept(s) that can be used to solve this challenge: Grille 2D, Chaines de caractères
Other challenges to complete