[Solved] C Use Text File Map Game Text File Contains Xxxxxxxpxxxoxxxxxxxxxxxpxo Opxxxxxopxxxxxxxxop Q37191179
C++ How do I use a text file as a map for a game? If I have atext file that contains:
xxxxxxxpxxxoxxxxxxxxxxxpxo
opxxxxxopxxxxxxxxopxxxpop
xxxxxxopxxpppppxxxxxooppp
Where x represents land, o represents water, and p represents atown.
What function do I need to first spawn the player on a randomspot of land only, then allow the player to move 1 space in a givedirection? Once the player moves, there will be a marker for wherethey are and print out a 2×2 area around them.The player can notmove on water unless they have an specific item.
Please do not put everything in int main.
Expert Answer
Answer to C++ How do I use a text file as a map for a game? If I have a text file that contains: xxxxxxxpxxxoxxxxxxxxxxxpxo opxxxx… . . .
OR

