- This code defines several functions to process an encoded message stored in a text file.
- The extractNumbers function reads the file, extracts the numbers from each line, and stores them in an array.
- The rearrangeIntoStaircase function takes the extracted numbers, sorts them, and arranges them into a staircase-like structure, where each step has one more number than the previous step.
- The returnLast function extracts the last number from each step of the staircase.
- The decode function uses these extracted numbers to retrieve corresponding words from the message file and constructs a decoded message.
- Finally, the writeToFile function writes the decoded message to a new text file named "decoded.txt".
tiago0214/encoding-challenge
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|