Taking characters in a txt file into an array
in
Programming Questions
•
3 years ago
Hi, beginner here. I'm trying to make a program that reads a text file and extract the data into an array. The text file would be something like
---oooo---
---o----o---
---o--------
In the end I want to draw a simple map of rooms (which could be useful for a 'rogue'-like games or any games with dungeons). In the file above, "o" is a room, and "-" is a wall. I want to extract each character in the txt into an array. Once I have the array, I can implement the drawing algorithms.
Any suggestions? Thanks in advance.
1
