Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Magic 8 Ball

by deibyz (Hermit)
on Jun 28, 2005 at 10:24 UTC ( #470562=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    use strict;
    ...
                     Try8Again8888AsXIXSee8It,XY
                       es888888"`;s/\s//g;eval
                              ;__DATA__
    
  2. or download this
    seek(DATA,30,0);local$/;$_=<DATA>;/8{6}(.*)8{6}/s;($a=$1)=~s/\s+(8+\s+
    +)*//g;$a=~s/X/\040/g;my@eight=split/888/,$a;@eight=split/8/,$eight[ra
    +nd(20)];s/(\s+88\s*(8?88)?\s+)/$b=int((length($1)-length($eight[0]))\
    +/2);sprintf("%-".length($1)."s","\040"x$b.shift(@eight))/eg;print;"88
    +888888888X8Outlook888888Good8888Outlook8NotXSo8Good88888888MyXReply8I
    +sXNo8888Don't8Count888888OnXIt8888YouXMay8RelyXOnXIt88888888Ask8Again
    +8Later8888Most8Likely888888888Cannot8Predict8Now8888X8Yes8888Yes8Defi
    +nately8888Better8NotXXTell8YouXNow8888ItXIs8Certain8888Very8Doubtful8
    +888ItXIs8Decidedly8So8888Concentrate8and8Ask8Again8888Signs8Point8ToX
    +Yes8888MyXSources8SayXNo8888Without8a8Doubt888Reply8Hazy,8Try8Again88
    +88AsXIXSee8It,XYes888888"
    
  3. or download this
    seek( DATA, 30, 0 ); # Get DATA handle to first line of code (after "u
    +se strict")
    local $/;    # slurp 
    ...
    #s/(\s+88\s*(8?88)?\s+)/$b=int((length($1)-length($eight[0]))\/2);spri
    +ntf("%-".length($1)."s","\040"x$b.shift(@eight))/eg; 
    print; # and print
    "88888888888X8Outlook888888Good8888Outlook8NotXSo8Good88888888MyXReply
    +8IsXNo8888Don't8Count888888OnXIt8888YouXMay8RelyXOnXIt88888888Ask8Aga
    +in8Later8888Most8Likely888888888Cannot8Predict8Now8888X8Yes8888Yes8De
    +finately8888Better8NotXXTell8YouXNow8888ItXIs8Certain8888Very8Doubtfu
    +l8888ItXIs8Decidedly8So8888Concentrate8and8Ask8Again8888Signs8Point8T
    +oXYes8888MyXSources8SayXNo8888Without8a8Doubt888Reply8Hazy,8Try8Again
    +8888AsXIXSee8It,XYes888888"
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2014-09-18 01:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (104 votes), past polls