Computer Science Canada

declaring a grid

Author:  JonnyBigBoi [ Tue Dec 14, 2004 11:59 am ]
Post subject:  declaring a grid

i need to make a grid on my game and im not sure how to use the function help me

Author:  Tony [ Tue Dec 14, 2004 12:01 pm ]
Post subject: 

what function are you talking about?

Author:  Delos [ Tue Dec 14, 2004 12:34 pm ]
Post subject: 

Perhaps by 'grid' he means multidimensional array, and by 'functions' he means commands and routines...

if you want to set up a representation of a grid (2 dimensional), use an array.

E.g.
code:

var grid : array 1..10, 1..10 of int


Each box in the grid will then be a reference in the array, for example grid (1, 1) is the variable name for the first box in the first row...etc etc.

If each element in your grid is going to have more complex behaviours than simply storing a number, then you'll need to use types and records too.

Read these:
Records by Dodge
Arrays by tony


: