There are not 2D arrays exactly, and this was a topic of discussion a while back. One solution was to use strings, since each string is basically an array and you can make an array of strings.
The other solution, which I didn't think about at the time, is that you can make a 1-dimensional array and assign each space on a 2D grid to a position in that array. You have to simply divide it into rows, and write a function that takes values X,Y and returns a place in your array.
If I want a 5x5 board, I can make an array of size 25. I'll label it starting from 0 for the example.
0 1 2 3 4
0 # # # # #
1 # # # # #
2 # # # # #
3 # # # # #
4 # # # # #
so to access tile (2,3) I would go to row 3 which is 5*3, and add 2.
(5*3)+2 = 17
so tile (2,3) is stored in array position 17.
This is how I think of it:
If you have an array that is 40000
Then that can be thought of as a grid 200 by 200
Now if the player Position variable Subtracts 200 at once thats Forward one space
If the player Position moves 1 number More thats to the Right one space
Adding 200 is Backwards
And Subtracting 1 is Left
You could use this in a rouge-like with text tiles, a game with sprites or a 3d environment. I have done all 3 to some extent.
// Create a number array of 40000
DIM worldGrid(40000)
// Create a string also known as a text array of 40000
DIM worldTextGrid$(40000)
// Create a space with a Wall
LET worldGrid(800) = 1
// Set where the player starts
LET playerPosition = 1200
// Move The player up one space
LET playerPosition = playerPosition - 200
// Make the player bounce back so the wall is like its solid
IF worldGrid(playerPosition) = 1 THEN
LET playerPosition = playerPosition + 200
END IF
// Move The player right one space
LET playerPosition = playerPosition + 1
Just change the numbers to the correct 200 or 1 and operators to + or - for the other directions.
There are many ways to show this information with a little effort, ideas and testing. Like a text adventure describing you walked forward, back, right, left or hit a wall. Also you could show it with sprites or on a text-tile based map(Rouge-Like).