Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Use radio noise to make (non-critical) decisions...

by insensate (Hermit)
on Jan 09, 2003 at 03:25 UTC ( [id://225424]=note: print w/replies, xml ) Need Help??


in reply to Use radio noise to make (non-critical) decisions...

Or...
use strict; use Quantum::Entanglement; $|++; print "Welcome to the magic 8 ball...type 'leave' to exit\n"; for(;;){ my $answer = entangle(1, 'Outlook Good', 1, 'Outlook Not So Good', 1, 'My Reply Is No', 1, 'Don\'t Count On It', 1, 'You May Rely On It', 1, 'Ask Again Later', 1, 'Most Likely', 1, 'Cannot Predict Now', 1, 'Yes', 1, 'Yes Definately', 1, 'Better Not Tell You Now', 1, 'It Is Certain', 1, 'Very Doubtful', 1, 'It Is Decidedly So', 1, 'Concentrate and Ask Again', 1, 'Signs Point to Yes', 1, 'My Sources Say No', 1, 'Without A doubt', 1, 'Reply Hazy, Try Again', 1, 'As I See It, Yes'); print "What is your question: "; my $ans = <STDIN>; chomp $ans; exit if $ans=~/^leave$/i; print "Rolling"; for(1..4) { sleep 1; print "."; } print "\n$answer\n"; }

Replies are listed 'Best First'.
Re^2: Use radio noise to make (non-critical) decisions...
by Aristotle (Chancellor) on Jan 11, 2003 at 20:28 UTC
    exit if $ans=~/^leave$/i;
    Hmm? Seems overly convoluted to me. exit if "leave" eq lc $ans; Update: Also:
    my $answer = entangle(map { 1 => $_ } 'Outlook Good', 'Outlook Not So Good', 'My Reply Is No', "Don't Count On It", 'You May Rely On It', 'Ask Again Later', 'Most Likely', 'Cannot Predict Now', 'Yes', 'Yes Definately', 'Better Not Tell You Now', 'It Is Certain', 'Very Doubtful', 'It Is Decidedly So', 'Concentrate and Ask Again', 'Signs Point to Yes', 'My Sources Say No', 'Without A doubt', 'Reply Hazy, Try Again', 'As I See It, Yes', );
    Just minor niggles of course.

    Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-03-19 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found