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


by mr_leisure (Beadle)
on Jan 09, 2001 at 21:32 UTC ( #50715=CUFP: print w/replies, xml ) Need Help??

This is Vroom's fault, so don't blame me.

You know on his homenode, he's got the "/msg me with good books" thing? Well a while ago, I read The Dice Man, by Luke Rhinehart and was blown away by it.

Using my limited perl skills, I have decided to emulate Dr Rhinehart's tools here.

In case you didn't click the above link, The Dice Man was a guy who had a pair of dice, and made decisions by them.
(example 3, 5, 7 - Quit my job,
2, 4, 6 - Stay,
Snake Eyes - Kill Myself)

The book is almost certainly fiction, but the thousands of cults that sprang up in the late 70s as a result certainly were not. A lot are still going strong today. The key to "living the dicelife" is one rule : always follow what they say. If you can't carry out an order, don't assign it in the first place.

In, I have created a little bit of fun, and also ten options at the bottom for diceliving. (To play the PerlMonks version, your usage is merely To play the dicelife version, it's -dice.) You can delete, edit, add as many as you want. Just remember Rule # 1.

I would be interested to see what people think of this, but it only ever works if you actually follow the rules. I have done it a couple of times, with pretty tame options, and the feeling is unbelievable.

Enough rambling.

#!/usr/bin/perl ########## # # # # Author : mr_leisure ( # # Usage : / -dice # # Requirements : TK and Long modules # ########## use Getopt::Long; use Tk; my %opt = (); GetOptions(\%opt, "dice!", #enables 'diceman' options ); srand; @names = qw ( Extremely Tilly Turnstep ybiC Zoogie Chipmunk Mirod Foot +pad Vroom Ovid Chromatic Danger Johannz Agoth Salvadors Davorg Mr_leisure Boo_rad +ley Mina Nate Merlyn Ichimunki Princepawn Notsoevil $code_or_die BBQ Dealga +n Wonko Jcwren Rastolfe Adam Tye Dominus AgentM Nuance Eduardo t0mas KM Bt +rott Zdog Guildenstern Mischief Repson Clemburg Zencrypt Lhoward Russ Japhy +Mdillon Corion BigJoe Arturo Jptxs Jjhorner Redmist Ozymandias Kudra OeufM +ayo Neophyte Snowcrash Hannibal Sutch Swiftone Gag PurlGurl Perlknight Macphist +o Petruchio MF Jima C-era Kschwab Mkmcconn ChOas Crazy_insomniac Dchetlin Core +olyn Kapper Redcloud PsychoSpunk Malkavian Tekniko Colderclimate j.a.p.h Erudi +l Russ Plaid Athomason ZZamboni Jeffa Neshura Mrmick Royalnjr Wombat PipTigger +Arturo); $rn = $names[rand @names]; $rn2 = $names[rand @names]; # perlmonks related stuff $one = "\nTell $rn you like to take long walks on the beach, usually w +ith $rn2.\n"; $two = "\nSpam the CB with \"Vroom, My Life for You!\".\n"; $three = "\nBuy a #!/usr/bin/perl bumpersticker, and stick it on your +forehead.\n"; $four = "\nTell $rn he should really read the documentation, just like + $rn2 said.\n"; $five = "\nTell $rn that $rn2 writes really sloppy code, and NEVER use +s the -w switch.\n"; $six = "\nTell $rn you are really $rn2 incognito.\n"; $seven = "\nYour task this week : ++ everything $rn has posted.\n"; $eight = "\nYour task this week : -- everything $rn has posted.\n"; $nine = "\n$rn is hungry. Feed them.\n"; $ten = "\nTell $rn that $rn2 told you that he downvoted them.\n"; $eleven = "\n\/msg $rn, telling them you really, really like them.\n"; $twelve = "\nAsk $rn if they are feeling ok. Can you get them anythin +g?\n"; $thirteen = "\n$rn is after you. Attack is the best form of defence!\n +"; $fourteen = "\nThe next time $rn says something in CB, repeat it.\n"; $fifteen = "\nWrite a book on Perl."; $sixteen = "\nTell $rn you taught $rn2 everything they know.\n"; $seventeen = "\nPost \"Why $rn Is A Fraud\", and make some wild accusa +tions.\n"; $eighteen = "\n-- the node that gave you this code.\n"; $nineteen = "\n++ the node that gave you this code.\n"; $twenty = "\nLearn a Language in 3 days.\n"; # diceman stuff $tone = "\nDon't go home for two days.\n"; $ttwo = "\nGo out tonight, and drink the entire bottle of something.\ +n"; $tthree = "\nStop playing this game.\n"; $tfour = "\nJoin a local club.\n"; $tfive = "\nGet a tattoo.\n"; $tsix = "\nGive 10 % of your paycheck to a charity.\n"; $tseven = "\nShoplift something of worth from your local store.\n"; $teight = "\nGo to Church every sunday this month.\n"; $tnine = "\nCall up an old friend right now.\n"; $thirty = "\nWrite Ten New Options for PerlDice.\n"; # perlmonks array @strings = ( $one, $two, $three, $four, $five, $six, $seven, $eight, $ +nine, $ten, $eleven, $twelve, $thirteen, $fourteen, $fifteen, $sixteen, $seven +teen, $eighteen, $nineteen, $twenty); #all options (careful - this includes the diceman array) @all = ($one, $two, $three, $four, $five, $six, $seven, $eight, $nine, + $ten, $eleven, $twelve, $thirteen, $fourteen, $fifteen, $sixteen, $seve +nteen, $eighteen, $nineteen, $twenty, $tone, $ttwo, $tthree, $tfour, $tfive, $tsix, + $tseven, $teight, $tnine, $thirty ); $rstring = $strings[rand @strings]; $rall = $all [rand @all]; if ($opt{dice}) { print "\t\nYou are using the DiceMan Mode : \n\n"; print "\tDISCLAIMER\n"; print "\tThe author of this program (mr_leisure)\n"; print "\tIs in no way responsible for the consequences\n"; print "\tOf using this program, direct or indirect. YOU are\n"; print "\tResponsible for your own actions.\n"; print "\n\n"; print "\n$rall\n"; } else { print "\nUser Friendly Mode : No Dice!\n"; print "\n$rstring\n"; } # copyright 2001 ltd - based on the philosophy of dr l +uke rhinehart
#if ($mr_leisure) { bow; }
UPDATE : Click here for the GUI Version. this is still not finished

Replies are listed 'Best First'.
Re: PerlDice
by merlyn (Sage) on Jan 09, 2001 at 21:35 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://50715]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2021-09-27 07:10 GMT
Find Nodes?
    Voting Booth?

    No recent polls found