Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: A little golfing challenge: replace digits by random letters

by vr (Curate)
on Feb 10, 2019 at 14:12 UTC ( [id://1229721]=note: print w/replies, xml ) Need Help??


in reply to Re^2: A little golfing challenge: replace digits by random letters
in thread A little golfing challenge: replace digits by random letters

Perhaps sort{rand(2)-1} (in effect, same as sort{0}) is somewhat too deterministic :). But

$ perl -E 'say sort{rand 2}a..z'

produces random enough strings, and is shorter.

Replies are listed 'Best First'.
Re^4: A little golfing challenge: replace digits by random letters
by bliako (Monsignor) on Feb 10, 2019 at 15:28 UTC

    ai! indeed it is. got bitten by int. This is uniformly random sort{rand(6)-4} and so is this sort{1-rand(3)%3}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-25 15:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found