Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: generating random thruth-tables

by toolic (Bishop)
on Sep 24, 2008 at 14:06 UTC ( [id://713434]=note: print w/replies, xml ) Need Help??


in reply to generating random thruth-tables

Really no need for both print and sprintf when just printf will suffice. And while I'm at it, I'll just reach into my (perl) golf bag and club your code down some:
perl -e'printf"%03b %b\n",$_,rand(2)for 0..7'

Replies are listed 'Best First'.
Re^2: generating random thruth-tables
by ambrus (Abbot) on Sep 24, 2008 at 18:24 UTC

    You can chop one character off like perl -e'printf"%03b %b\n",$_,rand 2for 0..7'.

Re^2: generating random thruth-tables
by neniro (Priest) on Sep 24, 2008 at 16:11 UTC
    I really like this - it's shorter and easier to read!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-26 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found