Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!ucsd!rutgers!mcnc!ecsvax.uncecs.edu!dlugose From: dlugose@uncecs.edu (Dan Dlugose) Newsgroups: comp.sys.mac.hypercard Subject: Re: shuffling a stack Message-ID: <1990Feb7.221615.18768@uncecs.edu> Date: 7 Feb 90 22:16:15 GMT References: <1990Feb6.193117.8068@ux1.cso.uiuc.edu> Organization: UNC Educational Computing Service Lines: 26 In article <1990Feb6.193117.8068@ux1.cso.uiuc.edu> gphg1125@uxa.cso.uiuc.edu (Glenn P Hoetker) writes: >Is there a simple command that would shuffle the cards in a stack so that they >were in a random order? If not, can someone give me pointers on a script >that would perform that function. thank you. This should do, and probably not very slow. Works if all cards are same background. -- first create new background field "neworder" put number of cards into n repeat with i = 1 to n put i into line i of cardlist end repeat repeat with i = 1 to number of cards put random(n) into choice -- choose a card to be number i in order put i into field neworder of card choice delete line choice of cardlist -- this card not eligible for reassignment subtract 1 from n -- 1 less card in list to choose from end repeat sort by field neworder Dan Dlugose UNC Educational Computing Service