Hello all,<br><br>I have a program in e-basic that takes two arrays and combines them, then randomizes and recombines them. Since I can't reuse any combinations that were in place previously, I have a loop structure in place to detect whether the combinations have been used. It goes something like this.<br>
<br>HeadColor(7) As String<br>HeadShape(7) As String<br>(takes values for each)<br>For a = 0 to a = 7<br> Heads(a) = HeadColor(a) + HeadShape(a)<br><br>/*randomize and check for repeats<br>Nomatch As Boolean<br>Nomatch = false<br>
Matches As Integer<br><br>While Nomatch = false<br> Randomize HeadColor<br> Randomize HeadShape<br><i> For b = 0 to b = 7<br> If HeadColor(b) + HeadShape(b) = Heads(b)<br> Matches = Matches + 1</i><br> End If<br> Next b<br>
If Matches = 0<br> Nomatch = true<br>Wend<br><br>Now -- in the highlighted FOR loop, if the If statement is true, it is basically saying that the entire While loop needs to be repeated and re-randomized (a match is present). Thus, the rest of the For loop is irrelevant. Is there a statement that can be used to end the for loop, like a break or end statement?<br>
<br>Also, if my code is horribly inefficient, feel free to critique me as I'm not a trained programmer.<br><br>Any help would be appreciated! Thanks!<br><br>Adam<br> <br><br>
--~--~---------~--~----~------------~-------~--~----~<br>
You received this message because you are subscribed to the Google Groups "E-Prime" group. <br> To post to this group, send email to e-prime@googlegroups.com <br> To unsubscribe from this group, send email to e-prime+unsubscribe@googlegroups.com <br> For more options, visit this group at http://groups.google.com/group/e-prime?hl=en<br>
-~----------~----~----~----~------~----~------~--~---<br>
<br>