Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: A Random Fortune Cookie

by choroba (Cardinal)
on Mar 10, 2021 at 21:46 UTC ( [id://11129429]=note: print w/replies, xml ) Need Help??


in reply to Re: A Random Fortune Cookie
in thread A Random Fortune Cookie

It's a special case of the Fisher-Yates shuffle, IIRC.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^3: A Random Fortune Cookie
by LanX (Saint) on Mar 10, 2021 at 22:39 UTC
    AFAIK does Fisher-Yates start with the highest range in rand not the lowest.

    The proof may contain similar elements but I have trouble seeing the obvious analogy...

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11129429]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found