Re: Change the mod result in list
Re: Change the mod result in list
- Subject: Re: Change the mod result in list
- From: Michelle Steiner <email@hidden>
- Date: Thu, 22 Aug 2002 10:54:22 -0700
Here is one (brute force) way:
set integerList to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
set N to 4
set resultList to {}
repeat with i in integerList
set foo to i mod N
if foo is 0 then set foo to 4
set end of resultList to foo
end repeat
Or you can do it this way:
set integerList to {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}
set N to 4
set resultList to {}
repeat with i in integerList
set end of resultList to (i mod N) + 4 * ((i mod N = 0) as integer)
end repeat
--Michelle
On Thursday, August 22, 2002, at 10:14 AM, bill wrote:
Is there any possible way to convert each 0 to 4? Like this one:
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
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.