May-04-2020, 10:42 AM
Hi i have to create a 2d game of sorts and to start it i need to create a function which reads in a text file and creates a list from each line.
and then from that line those characters are separated.
for example if the text file has
******F****
*****W*****
it needs to become
[****F****, *****W*****] and then
[[*,*,*,F,*,*,*,*],[*,*,*,*,W,*,*,*,*]]
from what ive heard you need to use a while loop with a nested while loop to achieve this but i just have no idea where to start.
and then from that line those characters are separated.
for example if the text file has
******F****
*****W*****
it needs to become
[****F****, *****W*****] and then
[[*,*,*,F,*,*,*,*],[*,*,*,*,W,*,*,*,*]]
from what ive heard you need to use a while loop with a nested while loop to achieve this but i just have no idea where to start.