random limited repetition from array...
- From: mj.clift@xxxxxxxxxx
- Date: 26 Jun 2006 12:40:01 -0700
Hi All,
I need to be able to choose a random string from an array. That is easy
enough, but I want to restrict the repetition of that string until one
or two other choices have been made. So the following output would be
ok a,b,c,a,d,c or a,c,d,a,d,a but the following would not; a,b,c,c, or
a,b,b,c, etc... I hope that makes sense.
If it helps to understand what I'm trying to do I have the following
python code.
for x in NumberChoices :
while FirstChoice in state[0:2]: #or for x in range(2):
FirstChoice = choice(NextChoice[Choice_List[-1]])
Sequence_List.append(FirstChoice)
state[x%2] = FirstChoice
I've just started with c# so any help would be of great help.
Thank you,
Calvin
.
- Follow-Ups:
- Re: random limited repetition from array...
- From: Larry Lard
- Re: random limited repetition from array...
- Prev by Date: Re: How do I know if its compiled for release?
- Next by Date: Re: P/Invoke calling mismatch
- Previous by thread: How do I know if its compiled for release?
- Next by thread: Re: random limited repetition from array...
- Index(es):
Relevant Pages
|