Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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

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

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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://225424]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2018-02-23 06:29 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (300 votes). Check out past polls.