You could write a couple for-next loops to read all the data into the array like so:
dim dungeon(5,5)
for a=1 to 5
for b=1 to 5
read dungeon(a,b)
next b
next a
data 0,0,0,0,0
data 0,1,1,1,0
data 0,1,1,1,0
data 0,1,1,1,0
data 0,0,0,0,0
That should read all the data into the array, which you can then check easily with:
if dungeon(heroy,herox)=0 then DON'T MOVE
Obviously, do your own thing for DON'T MOVE.
Now, here is what I think the logic should be for the motion (don't feel like doing all the code, but it should get you started):
1. Take input from player
2. Check to see if motion in that direction is allowed (compare it with the array)
3. If you can move there, then move there. If you can't tell them they can't.
Rinse and repeat
Ever notice how in Microsoft word, the word "microsoft" is auto corrected to be "Microsoft" but "macintosh" just gets the dumb red underline?