4.8 KiB
Codyssi - Compass Calibration!
Part 1
Difficulty Rating: 1
Following analysis of the data from the drones surveying the Atlantic Ocean, your lab is confident that they’ve located the fabled city of Atlantis!
Your team has been handpicked for this once-in-a-lifetime research mission. What an honor! Over the course of this trip, you know you’ll be facing a host of natural and supernatural threats. Luckily, your trusty laptop is waterproof, so you should be fine. Probably.
Soon enough, you and your team find yourselves in a sturdy land vehicle built for all-terrain travel, which will autonomously drive to the beach. There’s just one small issue: the autonomous vehicle isn’t driving itself…
“Look! It’s the navigation module! It must be faulty…”
Excellent! That’s not a hard fix: you’ll just have to recalibrate the vehicle’s compass!
You start the calibration diagnostics: 600 numbers and a long sequence of symbols appear on the monitor. Each number represents a reading in milliradians.
The first number in the file represents the initial compass offset. However, this isn’t the actual compass offset.
The following numbers represent the magnitudes (sizes) of the corrections to the initial compass offset. So, the second number corresponds to the first correction, the third number corresponds to the second correction, and so on.
The sequence of symbols is 599 characters in length and consists of “+” and “-”, representing the sign of each correction. The first symbol corresponds to the first correction, the second symbol corresponds to the second correction, and so on.
The vehicle’s actual compass offset, measured in milliradians, is calculated by adding all the corrections to the initial compass offset.
For example, consider this shorter file, with only 10 numbers and 9 symbols:
8 1 5 5 7 6 5 4 3 1 -++-++-++
The initial compass offset in this file is 8. The first correction is -1, the second correction is +5, the third correction is +5, and so on. To calculate the actual compass offset, the following calculation is performed: 8-1+5+5-7+6+5-4+3+1 = 21. So, for this shorter input, the actual compass offset is 21 milliradians.
Now, considering your file, what is the actual compass offset of the vehicle in milliradians?
(The answer is a number; do not enter ‘milliradians’ as part of your answer.)
Part 2
Difficulty Rating: 1
You enter the actual compass offset into the vehicle, and you notice that the navigation system is still faulty. Perhaps you missed something?
“Oh! The sequence of symbols is stated to be displayed in reverse order!”
Ah. You’ve missed a key instruction. No worries; it happens to the best of us.
As the sequence of symbols is in reverse order, the last symbol now corresponds to the first correction, the second-last symbol now corresponds to the second correction, and so on. You’ll still have to determine the actual compass offset by adding all the corrections to the initial compass offset.
For example, consider the same shorter file:
8 1 5 5 7 6 5 4 3 1 -++-++-++
The initial compass offset in this file is still 8; however, some of the corrections have changed! The first correction is now +1, the second correction is +5, the third correction is now -5, and so on. To calculate the actual compass offset now, the following calculation is performed: 8+1+5-5+7+6-5+4+3-1 = 23, and so the actual compass offset is now 23 milliradians.
Considering your file, what is the new actual compass offset of the vehicle in milliradians?
Part 3
Difficulty Rating: 2
You’ve taken a step in the right direction, but the navigation system still seems a little defective! Whatever caused this issue, it better not be another missed instruction…
Oh, would you look at that, another team member spots another instruction that you somehow missed. This is going great, isn’t it?
The initial compass offset and all the corrections are meant to be 2-digit numbers!
The instruction states that the readings are represented by the two numbers on pairs of consecutive lines. This means that the first reading is represented by lines 1 and 2, the second is represented by lines 3 and 4, the third is represented by lines 5 and 6, and so on.
For each pair of lines, the first number represents the tens digit of the reading, and the second number represents the ones digit of the reading.
Though, this means that you won’t use all of the symbols in the file.
For example, consider the same shorter file:
8 1 5 5 7 6 5 4 3 1 -++-++-++
Now, the initial compass offset would be 81. The corrections in file order are now +55, +76, -54, and +31. The calculation to find the actual compass offset is now 81+55+76-54+31 = 189. So, the actual compass offset for this file is 189 milliradians.
Considering your file, what is the actual compass offset in milliradians now?