
-----------------------------------
Thuged_Out_G
Sat Jan 24, 2004 12:11 am

2-dimensional arrays
-----------------------------------
2D ARRAYs


var x_y:1..2,1..3


if you think of them as table, it makes sense ....1..2 if the number of collums, and 1..3 is the number of rows


 ------------
|1,1  |  2,1|
 ------------
|1,2  |  2,2|
 ------------
|1,3  |  2,3|
 ------------


this could be useful for storing x and y coords of something.


var x,y,button:int
loop
for i:1..3
Mouse.Where(x,y,button)
if button=1 then
x_y(1,i):=x
x_y(2,i):=y
end if
end for
end loop

for i:1..3
put "Xcoords: ",x_y(1,i)
put "Ycoords: ",x_y(2,i)
end for


-----------------------------------
thoughtful
Sat Jan 24, 2004 12:19 am


-----------------------------------
nice simple tutorial, yea just to point out, i have used 2D arrays with whatdotcolor (for saving pictures as text files basically getting the color of each dot) , i have also used it with database records. It can be very use ful.

-----------------------------------
JayLo
Sat Jan 24, 2004 9:43 am


-----------------------------------
there's an alignment problem on this page.

-----------------------------------
Andy
Sat Jan 24, 2004 12:25 pm


-----------------------------------
ummm i already had a tutorial on arrays that included multi dimensions

-----------------------------------
Tony
Sat Jan 24, 2004 2:23 pm


-----------------------------------
i fixed the alighnment problem... it often occurs when multiple code tags are used. quote seems to not have such a probelem.

and yes... both dodge and I covered multidimentional arrays in our tutorials
