Code:
proc/PileRandom(list/TheDeck)
var
list/piles[6]
list/newdeck[]
ii=0
pilenum=0
CardNum=0
while(TheDeck.len>0)
ii++
pilenum=ii%6
if(pilenum==0) pilenum=6
CardNum=rand(1,TheDeck.len)
piles[pilenum].Add(TheDeck[CardNum])
TheDeck.Cut(CardNum, CardNum+1)
while(piles.len>0)
pilenum = rand(1,piles.len)
newdeck+=piles[pilenum]
piles.Cut(pilenum,pilenum+1)
TheDeck.Cut()
TheDeck.Add(newdeck)
Problem description:
piles[pilenum].Add(TheDeck[CardNum]) error: .: expected end of statement
The same thing happens with all of the built-inlist procs;
Add, Copy, Cut, Find, Insert, Remove & Swap
That's how it's done.