Let's say I would like to emulate a board game like Chess, Queen, Kamisado etc.
Those board games have 64 fields (8x8).
My first idea was to create an Associative Array which contains the middle points of all fields.
E.g. Middle of A1 would be x50, y50 / B1's middle would be x150, y50 etc.
A while ago I wanted to create an Associative Array which contained a lot of elements, and it did not work.
(It seems I reached some limit).
I think for these 64 elements (which have both an X and a Y value), it won't work either.
For this reason I have two other ideas:
1)
Creating 64 associative arrays, named A1, B1, C1 etc. with x and y values.
Code: Select all
A1 := {x:50, y:50}
B1 := {x:150, y:50}
C1 := {x:250, y:50}
etc.
(We're speaking about 64 arrays. )
2)
Creating only 2 arrays which contain each 8 values.
The first array is for the X values and the second one for the Y's.
After linking the elements, I should theoretically retrieve the exact coordinates of a specific field.
Element 5 of Array 1 (x) and element 3 of Array 2 (Y) would be: E3 -> 450x250
Code: Select all
xArray := {"A": 50, "B": 150, "C": 250, "D": 350, "E": 450 etc.}
yArray := {"1": 50, "2": 150, "3": 250, "4": 350, "5": 450 etc.}
Best regards