Multidimensional Anonymous Arrays (Language Help)

by jwc3119, Monday, February 27, 2012, 09:23 (2063 days ago) @ Steve K

the dimension statement for a two dimensional array (for a 5x5 array called "grid" is just:

dim grid(5,5)

(remember that each array index for this case would go from 0 to 4 and not 1 to 5)

Hi guys, I'm just starting out with BASIC256 and I'm hoping to teach it to a class of children soon. It's looking quite good so far but I've hit a small problem: is there any way to initialise a multidimensional array? Something like:

grid = { { 1, 2, 3, 1, 1 },
{ 2, 0, 2, 1, 0 },
{ 0, 1, 1, 2, 3 },
{ 3, 2, 1, 0, 0 },
{ 0, 1, 2, 0, 3 } }

I could possibly use one big one-dimensional array instead, or load the data from a file, but these are complications I was hoping to avoid at the moment.

Anyway, thanks for making this neat little language :)


Complete thread:

 RSS Feed of thread

powered by my little forum