Re: Question: Arrays and Matrixes
Re: Question: Arrays and Matrixes
- Subject: Re: Question: Arrays and Matrixes
- From: Timothy Bates <email@hidden>
- Date: Tue, 12 Mar 2002 18:22:17 +1100
On 12/3/02 5:58 PM, "email@hidden" <email@hidden> wrote:
>
I'm starting to try to play around with construction and filling of
>
multi-dimensional arrays/matrixes, but I can't find or figure out the correct
>
verbage to create one. Specifically, I'd like to create a 4 dimensional array
>
(100x250x320x160) filled with datatype character.
>
>
But, for clarification, a two dimensional one should work... For example, if
>
you envision a tic-tac-toe board (a grossly simplified example) as a 3 x 3
>
array of type character, with each data containing either nothing, X or O,
>
how would I create this array?
In AppleScript arrays are lists. Multidimensional arrays are lists of lists.
Yo can mix types. Anyhow. Tic-tac-to =
Set theBoard to{{"","",""},{"","",""},{"","",""}}
on mymove()
set item 1 of item 2 of theBoard to "X"
end mymove
-->{{"","",""},{"X","",""},{"","",""}}
| |
_____
X____
| |
tim
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.