Finish folding the transparent paper according to the instructions. The manual says the code is always eight capital letters. The letters ABCDEFGHJKLOPRSUZ
are represented in the following way:
.##. ###. .##. ###. #### #### .##. #..# ..## #..# #... .##. ###. ###. .### #..# ####
#..# #..# #..# #..# #... #... #..# #..# ...# #.#. #... #..# #..# #..# #... #..# ...#
#..# ###. #... #..# ###. ###. #... #### ...# ##.. #... #..# #..# #..# #... #..# ..#.
#### #..# #... #..# #... #... #.## #..# ...# #.#. #... #..# ###. ###. .##. #..# .#..
#..# #..# #..# #..# #... #... #..# #..# #..# #.#. #... #..# #... #.#. ...# #..# #...
#..# ###. .##. ###. #### #... .### #..# .##. #..# #### .##. #... #..# ###. .##. ####
Two letters are always separated with a column that only consists of dots (.
).
What code do you use to activate the infrared thermal imaging camera system? Determine this in the following way:
dots
that takes the pathname (char*
) of a text file containing a list of dots on a transparent paper, an empty line and a list of fold instructions. The function must return the code of eight capital letters (char*
) that activates the infrared thermal imaging camera system.In this interactive session we assume the text file paper.txt
1 is located in the current directory.
> dots("paper.txt")
"RPCKFBLR"
After all fold instructions have been applied, this transparant paper looks like:
###..###...##..#..#.####.###..#....###.
#..#.#..#.#..#.#.#..#....#..#.#....#..#
#..#.#..#.#....##...###..###..#....#..#
###..###..#....#.#..#....#..#.#....###.
#.#..#....#..#.#.#..#....#..#.#....#.#.
#..#.#.....##..#..#.#....###..####.#..#