Airport Arrivals/Departures - #1
Description:
You are at the airport staring blankly at the arrivals/departures flap display...

How it works
You notice that each flap character is on some kind of a rotor and the order of characters on each rotor is:
ABCDEFGHIJKLMNOPQRSTUVWXYZ ?!@#&()|<>.:=-+*/0123456789
And after a long while you deduce that the display works like this:
Starting from the left, all rotors (from the current one to the end of the line) flap together until the left-most rotor character is correct.
Then the mechanism advances by 1 rotor to the right...
...REPEAT this rotor procedure until the whole line is updated
...REPEAT this line procedure from top to bottom until the whole display is updated
Example
Consider a flap display with 3 rotors and 1 line which currently spells CAT
Step 1 (current rotor is 1)
- Flap x 1
- Now line says
DBU
Step 2 (current rotor is 2)
- Flap x 13
- Now line says
DO)
Step 3 (current rotor is 3)
- Flap x 27
- Now line says
DOG
This can be represented as
lines // array of strings. Each string is a display line of the initial configuration
rotors // array of array-of-rotor-values. Each array-of-rotor-values is applied to the corresponding display line
result // array of strings. Each string is a display line of the final configuration
e.g.
lines = ["CAT"]
rotors = [[1,13,27]]
result = ["DOG"]
Kata Task
Given the initial display lines and the rotor moves for each line, determine what the board will say after it has been fully updated.
For your convenience the characters of each rotor are in the pre-loaded constant ALPHABET
which is a string.
And don't forget to try my other flap display Katas!
:-)
Similar Kata:
Stats:
Created | Oct 12, 2016 |
Published | Dec 11, 2016 |
Warriors Trained | 11875 |
Total Skips | 4708 |
Total Code Submissions | 25656 |
Total Times Completed | 2847 |
JavaScript Completions | 756 |
Java Completions | 764 |
Python Completions | 812 |
PHP Completions | 328 |
Ruby Completions | 124 |
C# Completions | 129 |
Total Stars | 294 |
% of votes with a positive feedback rating | 95% of 610 |
Total "Very Satisfied" Votes | 559 |
Total "Somewhat Satisfied" Votes | 45 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 11 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |