I was able to get the code to sort. But I am trying to use grep to take out the repeating numbers. How do I do that? This is what I have below.
for ($i_lottery=0; $i_lottery<$NumberOfTickets; $i_lottery++) { for ($i=0; $i<$NumbersOnTickets; $i++) { $lotto[$i]= int(rand($HighestNumberOnTicket)) + 1; } grep($NumbersOnTickets,@lotto); $NumbersOnTickets=@lotto; @sorted = sort { $a <=> $b } @lotto; print "@sorted"; print "<P>"; }
In reply to Re^2: Take out repeating numbers with grep
by tangieb01
in thread How do I get my code to not repeat numbers and also sort the numbers
by tangieb01
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |