Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
2-dimensional arrays
Author Message
Thuged_Out_G

Posted: Sat Jan 24, 2004 12:11 am   Post subject: 2-dimensional arrays

2D ARRAYs

Quote:

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

Quote:

------------
|1,1 | 2,1|
------------
|1,2 | 2,2|
------------
|1,3 | 2,3|
------------

this could be useful for storing x and y coords of something.

 code: 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

Posted: Sat Jan 24, 2004 12:19 am   Post subject: (No subject)

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

Posted: Sat Jan 24, 2004 9:43 am   Post subject: (No subject)

Andy

Posted: Sat Jan 24, 2004 12:25 pm   Post subject: (No subject)

ummm i already had a tutorial on arrays that included multi dimensions
Tony

Posted: Sat Jan 24, 2004 2:23 pm   Post subject: (No subject)

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
Tony's programming blog. DWITE - a programming contest.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 5 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: