I am a novice programmer trying to add an unnecessary and complicated element to a text adventure! ...and I've run into a question I am not sure how to research further (I suspect due to lack knowledge of the proper terminology).
I am working on a small text adventure that uses an 11x11 array. Player is capable of moving into spaces with a 1 and incapable of moving to a 0. I need to a) retain the outer boundary 0s, b) randomize the content inside the border, and c) ensure that there is a linked path of 1s that will eventually connect to a 2 (the exit):
0 0 0 0 0 0 0 0 0 0 0
0 1 1 0 0 0 0 1 0 0 0
0 0 1 1 1 1 1 1 1 1 0
0 0 1 0 0 0 0 0 0 1 0
0 0 1 1 1 1 1 1 1 1 0
0 1 1 0 1 0 1 0 0 0 0
0 1 0 0 1 0 1 0 0 0 0
0 1 1 1 1 0 1 1 1 2 0
0 0 0 1 0 0 1 0 0 0 0
0 0 0 0 0 0 1 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0
I'd appreciate any pointers here - not sure what direction I should be looking in. Thinking of scrapping this feature so if it's not viable I don't mind hearing that :) Thanks for reading.