i am new to Ruby and working on a project to take in text from a file, convert the text to braille format, and then put the braille text into a new file.
Right now I am able to read the text, convert the entire string to an array. Then using a hash of English characters to braille, I am able to run map and replace the elements of the array with their braille equivalent.
I am having trouble interacting with the new array of Braille characters due to formatting issues.
starting_message = ["h", "e", "l", "l", "o", " ", "w", "o", "r", "l", "d"]
braille_converted_message = [
"0.\n00\n..",
"0.\n.0\n..",
"0.\n0.\n0.",
"0.\n0.\n0.",
"0.\n.0\n0.",
"..\n..\n..",
".0\n00\n.0",
"0.\n.0\n0.",
"0.\n00\n0.",
"0.\n0.\n0.",
"00\n.0\n.."]
I need to print the new array onto a file element by element including the correct formatting. i.e.
0.0.
00.0
....
The issue I am having is it either doesn't format correctly as in just appears as 0.\n00\n.. or puts in one vertical line.