Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: While issues

by Dandello (Scribe)
on Feb 03, 2011 at 16:36 UTC ( #886022=note: print w/replies, xml ) Need Help??

in reply to Re: While issues
in thread While issues

Your initial solution was SO much better than mine. So that's the one I'm using.

I needed to find the first random non-blank element. Using shuffle worked, but I was looking for a neater and simpler way.

Again, thank you.

My final -

while (1) { my $xda = int rand $total + 1; if ( defined $aob[$xda][ $y - 1 ] ) { $aob[$x][$y] = $z + $aob[$xda][ $y - 1 ]; last; } }
. Using 'defined' is actually better in this case than using "" or q{}. No warnings.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://886022]
[choroba]: Can you steal the code from pm-cb-g?
[Tanktalus]: maybe next week at the earliest. :P
[Tux]: Don't you ♥ Unicode :)
[Tanktalus]: Tux: usually, yes. :P

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-09-25 21:26 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (291 votes). Check out past polls.