MACSCRPT Archives

April 2008

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Cleveland <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Wed, 16 Apr 2008 14:51:49 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (36 lines)
On 4/16/08 12:55 PM, "Stockly, Ed" wrote:

> set fullDeck to {}
> repeat with s in {" of H", " of C", " of S", " of D"}
>     repeat with x from 1 to 13
>         if x = 1 then
>             set c to "A"
>         else if x = 11 then
>             set c to "J"
>         else if x = 12 then
>             set c to "Q"
>         else if x = 12 then --> repeated line!
>             set c to "Q"    --> repeated line!
>         else if x = 13 then
>             set c to "K"
>         else
>             set c to x as string
>         end if
>         set the end of fullDeck to c & s
>     end repeat
> end repeat

Does the following change make the script faster or slower? (I don't know
where the command "the ticks" comes from, so am unable to check it here.)

set fullDeck to {}
repeat with s in {" of H", " of C", " of S", " of D"}
    repeat with x from 1 to 13
        set c to item x of "A234567890JQK"
        if c = "0" then set c to "10"
        set the end of fullDeck to c & s
    end repeat
end repeat

Stan C.

ATOM RSS1 RSS2