• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question: Arrays and Matrixes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Question: Arrays and Matrixes (From: email@hidden)

  • Prev by Date: Question: Arrays and Matrixes
  • Next by Date: file size and creation date
  • Previous by thread: Question: Arrays and Matrixes
  • Next by thread: Re: Question: Arrays and Matrixes
  • Index(es):
    • Date
    • Thread