Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Predicting the end of times...

by vladb (Vicar)
on Jul 06, 2002 at 04:58 UTC ( [id://179803]=CUFP: print w/replies, xml ) Need Help??

Speaking of unique uses of Perl?

How about predicting the end of times? Do you have Apocalypse on your mind? Well, watch what Perl can do:
$x = 0; $s = "HOLY BIBLE"; # # add up ASCII codes for all letters in the $s string. # (also, print out extra information) # $s =~ s/(\w)/{$x+=($o=ord($1));print"$1 - $o\n";''}/eg; print "Total: $x\n";
Output:
H - 72 O - 79 L - 76 Y - 89 B - 66 I - 73 B - 66 L - 76 E - 69 Total: 666
There's actually a lot of other mathematically legitimate ways of obtaining the number 666. I found this one where it's being derived from the word 'HOLY BIBLE' particularly interesting, since it is in this book that a reference is made to 666 as being the number of the beast in the end of times.

_____________________
# Under Construction

Replies are listed 'Best First'.
(jeffa) Re: Predicting the end of times...
by jeffa (Bishop) on Jul 06, 2002 at 17:19 UTC
    Well, if we are all going to hell in a handbasket, i am going with a golfed one-liner!!
    perl -le'$x+=ord,print"$_ - ",ord for split//,HOLYBIBLE;print"Total: $ +x"'

    jeffa

    jeffa suddenly notices cumulonimbus clouds forming over him "uh-oh"
      Why do I get this when I try your one liner..?
      Can't find string terminator "'" anywhere before EOF at -e line 1.
      -----
      Of all the things I've lost in my life, its my mind I miss the most.
        Are you running this on Win32? If so, try this one (which will not work in a Unix shell):
        perl -le"$x+=ord,print qq|$_ - |,ord for split//,HOLYBIBLE;print qq|To +tal: $x|"
        The problem is that Win32 wants the whole expression wrapped in double quotes (not single quotes), and Unix shells will interpolate any tokens in double quotes before Perl gets a chance to execute. This results in Yet Another Platform Dependance for Perl one-liners that contain dollar signs. You can escape the quotes, but that gets ugly (uglier?) real quick. For example, this should work on both platforms (but since i don't have a Win32 box available, i can't test it on that platform):
        perl -le"\$x+=ord,print\"\$_ - \",ord for split//,HOLYBIBLE;print\"Tot +al: \$x\""
        Update - nope, the previous one only works on Unix shells, Win32 doesn't need (or like) the escaped dollar signs. Thanks for testing this for me, BlueBlazerRegular and BrowserUk. :)

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        
Re: Predicting the end of times...
by zentara (Archbishop) on Jul 06, 2002 at 16:35 UTC
    I take it to be an omen that the upcoming release of 6
    is coming, and that it will be the "HOLYBIBLE" of programming.
Re: Predicting the end of times...
by janx (Monk) on Jul 09, 2002 at 10:16 UTC
    since it is in this book that a reference is made to 666 as being the number of the beast in the end of times.

    One could argue that it's ASCIIs fault, though.
    Actually, I'm pretty certain that's the root of said evil ;-)

    Kay

      So does anyone know the Hebrew ordinal system? That's what 666 was from... Hebrew words are also numbers, since they used letters for digits. Something like that.

      Update: ybiC found this link. The author didn't include <A NAME> tags, so scroll down to the table following “Could you refresh my memory how numbers work in Hebrew?”

      Interestingly enough, this is the same site that has Hotbits (as in Genuine Quantum Randomness).

        (Very off topic)I'm not sure about this. All this 666 business comes from the Revelation in the New Testament, the majority of which was originally in Greek, not Hebrew.

        This is pretty cool tho'--I do admire the arbitrariness of spelling 'HOLY BIBLE' in English, and totalling up the ASCII values. ++s all round.

      One could argue that it's ASCIIs fault, though. Actually, I'm pretty certain that's the root of said evil ;-)
      I thought Java was the root of all evil...


      ----
      Zak
      "There is no room in this country for hyphenated Americanism" ~ Theodore Roosevelt (1915)
Re: Predicting the end of times...
by krujos (Curate) on Jul 11, 2002 at 14:19 UTC
    you left out the space...
    ...
    Y = 89
    \s = 32
    B = 66
    ...
    Take it to mean what you will... perhaps 698 is the mark of the stain on my shirt?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://179803]
Approved by newrisedesigns
Front-paged by cjf
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 18:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found