sub kuji(AREAid, AREAnum, ary, POTnum, ROWnum, AVOid) for i=0 to (AREAnum-1) Do index = int(rnd*POTnum) Loop until ary(index*2)=AREAid Do Do selG = int(rnd*8) Loop until grp(selG,ROWnum,0)="" Loop until grp(selG,0,0)<>AVOid grp(selG,ROWnum,0) = ary(index*2) grp(selG,ROWnum,1) = ary(index*2+1) ary(index*2) = "" next end sub