How do I create random numbers that are nonrepeating using applescript -


trying figure out how create non-repeating numbers using applescript. if want random numbers 1 or 2, want result [1, 2] or [2, 1] , never [1, 1] or [2, 1].

so need figure out way can make sure numbers non-repeating, else know how do. if there unix command can run in applescript, let me know.

the next applescript generate non-repeating random-number pairs - range 1..100

set maxvalue 100 set thepairs {} repeat until (count thepairs) = 2    set randomnumber (random number 1 maxvalue)    if thepairs not contain {randomnumber} set end of thepairs randomnumber end repeat thepairs 

i hope not modify question again other.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -