How about this as a quick example?
// Create user defined types
type type_location
description as string
isTraversible as boolean
name as string
endType
// Setup the display
set window on
set window title "Text Based Map"
set display mode 1024, 768, 32
// Lock the frame rate
sync on
sync rate 60
sync
// Setup the backdrop
backdrop on
color backdrop 0x212121
// Create the list of locations from the data statements
global LOCATION_COUNT as integer
restore Data_Locations
read LOCATION_COUNT
global dim locations(LOCATION_COUNT) as type_location
for l = 0 to LOCATION_COUNT
local description as string
local isTraversible as boolean
local name as string
read name, description, isTraversible
locations(l).description = description
locations(l).isTraversible = isTraversible
locations(l).name = name
next l
// Create the map from the data statements
global MAP_WIDTH as integer
global MAP_HEIGHT as integer
restore Data_Map
read MAP_WIDTH, MAP_HEIGHT
global dim map(MAP_WIDTH, MAP_HEIGHT) as integer
for y = 0 to MAP_HEIGHT
for x = 0 to MAP_WIDTH
local mapLocation as integer
read mapLocation
map(x, y) = mapLocation
next x
next y
// Start the player off at home
global PlayerX as integer : PlayerX = 1
global PlayerY as integer : PlayerY = 4
// Variables for text entry
global cursorFlash as integer : cursorFlash = 0
global response as string : response = "The available commands are NORTH, EAST, SOUTH, WEST or EXIT."
// Start the main loop
global breakLoop as boolean : breakLoop = 0
while (breakLoop = 0)
// Render text describing the current location
text 0, 0, "You are currently at " + locations(map(PlayerX, PlayerY)).name + "." + str$(PlayerX) + "," + str$(PlayerY)
text 0, 20, locations(map(PlayerX, PlayerY)).description
// Render text describing the surroundings
if (PlayerY > 0)
text 0, 60, "To the NORTH is " + locations(map(PlayerX, PlayerY - 1)).name
else
text 0, 60, "To the NORTH is the edge of the world"
endIf
if (PlayerX < MAP_WIDTH)
text 0, 80, "To the EAST is " + locations(map(PlayerX + 1, PlayerY)).name
else
text 0, 80, "To the EAST is the edge of the world"
endIf
if (PlayerY < MAP_HEIGHT)
text 0, 100, "To the SOUTH is " + locations(map(PlayerX, PlayerY + 1)).name
else
text 0, 100, "To the SOUTH is the edge of the world"
endIf
if (PlayerX > 0)
text 0, 120, "To the WEST is " + locations(map(PlayerX - 1, PlayerY)).name
else
text 0, 120, "To the WEST is the edge of the world"
endIf
// Show text entry
text 0, 160, response
inc cursorFlash
if (cursorFlash < 10)
text 0, 180, upper$(entry$(1)) + "|"
else
text 0, 180, upper$(entry$(1))
if (cursorFlash > 19)
cursorFlash = 0
endIf
endIf
// Handle a text entry
if (returnKey() = 1)
// Grab the entry
local entryText as string : entryText = left$(upper$(entry$(1)), len(entry$(1)) - 1)
clear entry buffer
// Respond to entry
select entryText
// Exit
case "EXIT":
breakLoop = 1
endCase
// Move North
case "NORTH":
if (PlayerY > 0)
if (locations(map(PlayerX, PlayerY - 1)).isTraversible = 1)
dec PlayerY
response = "You move North."
else
response = "You can't move that way."
endIf
else
response = "You can't move that way."
endIf
endCase
// Move East
case "EAST":
if (PlayerX < MAP_WIDTH)
if (locations(map(PlayerX + 1, PlayerY)).isTraversible = 1)
inc PlayerX
response = "You move East."
else
response = "You can't move that way."
endIf
else
response = "You can't move that way."
endIf
endCase
// Move South
case "SOUTH":
if (PlayerY < MAP_HEIGHT)
if (locations(map(PlayerX, PlayerY + 1)).isTraversible = 1)
inc PlayerY
response = "You move South."
else
response = "You can't move that way."
endIf
else
response = "You can't move that way."
endIf
endCase
// Move North
case "WEST":
if (PlayerX > 0)
if (locations(map(PlayerX - 1, PlayerY)).isTraversible = 1)
dec PlayerX
response = "You move West."
else
response = "You can't move that way."
endIf
else
response = "You can't move that way."
endIf
endCase
// No idea!
case default:
response = "Sorry, that is not a valid instruction. Try NORTH, EAST, SOUTH, WEST or EXIT."
endCase
endSelect
// Wait for return to be released
while (returnKey() = 1)
endWhile
endIf
// Update the screen
sync
endWhile
// Clean up
unDim locations()
unDim map()
// Exit the application
end
// Declare the location data
Data_Locations:
data 5
data "a wall", "A dull and ordinary wall.", 0
data "a path", "A pathway just asking to be walked down.", 1
data "your house", "It's not much, but it's home!", 1
data "a rock", "Grey...solid...yup, it's a rock!", 1
data "a hard place", "A hard place...to describe. So I won't.", 1
data "the castle", "Ooh, a fancy castle! I bet someone rich lives there.", 1
// Declare the map data
Data_Map:
data 4, 4
data 0, 1, 1, 1, 5
data 0, 1, 0, 0, 0
data 0, 1, 0, 0, 0
data 0, 1, 0, 0, 0
data 3, 2, 4, 0, 0
Let me know if any of it doesn't make sense or have any other questions. I hope it helps a bit!

Previously TEH_CODERER.