Randomly outputting an array
- From: "ryanarossi@xxxxxxxxx" <ryanarossi@xxxxxxxxx>
- Date: 14 Jul 2006 10:49:18 -0700
What would be the simplest way to output an array in random order, but
every element in the array MUST be outputted and the elements cannot
repeat? My current code is below, which I simply have a very large
array and I am outputting windows of an arbitary length.
int c = 0;
int p = windowSize;
int q = 0;
int index = 0;
while (c < counter0 - (windowSize - 1))
{
for (index = q; index < p; index++)
{
Writer.Write(geneArray0[index]);
Writer.Write(" ");
}
Writer.Write("1");
Writer.WriteLine();
q++;
p++;
c++;
}
.
- Follow-Ups:
- Re: Randomly outputting an array
- From: jimmaureenrogers@xxxxxxxxxxxxxxxx
- Re: Randomly outputting an array
- From: Gerry Quinn
- Re: Randomly outputting an array
- From: rossum
- Re: Randomly outputting an array
- From: jon
- Re: Randomly outputting an array
- From: Richard Heathfield
- Re: Randomly outputting an array
- From: Ico
- Re: Randomly outputting an array
- Prev by Date: Re: C is too old? opinions?
- Next by Date: Re: Randomly outputting an array
- Previous by thread: data structure question
- Next by thread: Re: Randomly outputting an array
- Index(es):
Relevant Pages
|