Computer Science Canada

Help with co-ords...

Author:  1337_brad [ Sat Nov 27, 2004 12:26 am ]
Post subject:  Help with co-ords...

I need to have something to remember co-ords,

I had this code

code:

    for i : 1 .. 500
         for j : 1 .. 500
            if itematx(i)= 1 and itematy(j)= 1 then
                Pic.Draw (pillow1, i, j, picMerge)

             end if
        end for
     end for
    View.Update
 end if



But that gave me alot of problems due to if I use arrays, the properties are true for more than one co-ord... but anyway... HELP! :p

Author:  SuperGenius [ Sat Nov 27, 2004 1:01 am ]
Post subject: 

It is difficult to understand this fragment of code. If you post the rest or at least explain what your arrays are supposed to be holding then it will be less confusing for someone trying to help.

Author:  wtd [ Sat Nov 27, 2004 1:03 am ]
Post subject:  Re: Help with co-ords...

1337_brad wrote:
I need to have something to remember co-ords,

I had this code

code:

    for i : 1 .. 500
         for j : 1 .. 500
            if itematx(i)= 1 and itematy(j)= 1 then
                Pic.Draw (pillow1, i, j, picMerge)

             end if
        end for
     end for
    View.Update
 end if



But that gave me alot of problems due to if I use arrays, the properties are true for more than one co-ord... but anyway... HELP! :p


Sounds like you need a multi-dimensional array. That would create a grid of values.

code:
var myArray : array 1 .. 500, 1 .. 500 of int


Something like that.

Author:  Martin [ Sat Nov 27, 2004 2:52 am ]
Post subject: 

An array of arrays, if you will.


: