Re: Wishing well
Chris Angelico <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <CAPTjJmqBtJCNXC+bWzT_ZKBEbUNJbC5R1J8CU1m69OKbaJY0Ew@mail.gmail.com> |
On Tue, Nov 18, 2014 at 11:24 PM, 郭雪松 <[email protected]> wrote: > Consider this: > > Howto create a array of multiset, every item of the array should be uniq. > using ByValue, I do it like this: > > array res=({}); > multiset done=(<>); > for(int i=0;i<100;i++){ > for(int j=0;j<100;j++){ > int t=random(100); > object ob=ByValue.Set(i,j,t); > if(!done[ob]) > res+=({(<i,j,t>)}); > } > } Hmm. Seems an unusual thing to do... although this is a contrived example, and they never look particularly impressive. Are you able to represent the sets as strings? An array (or multiset) of strings is pretty efficient and easy to work with. ChrisA