Saving data from a textfile in a 2D array

Hey guys, I'm making a text-based maze game. I want the user to be able to specify his own direction controlls to move through the maze. If I have a textfile that contains the following lines:

n w
s s
e d
w a
ne e
nw q
se z
sw c

The first letter represents the direction (n = north, s = south, ect) and the second letter represents the keyboard button to move in that direction. I want to create a function that reads the text file and then saves the first letter, and the second letter of each line in a 2D array, so that I can later easily access them to define the movement.

Any help would be greatly appreciated, thanks!
Topic archived. No new replies allowed.