http://www.perlmonks.org?node_id=316962

What this obfu lacks in cunning obfuscation it makes up for in generosity, for it keeps on giving in the spirit of this holiday season.

Enjoy the insight normally reserved only for Santa and his elves. Happy Holidays!

my(@g,@b);while(my$l=<DATA>){chomp$l;my@s=split/\|/,$l;for(@s){my$ty= chop;tr/a-zA-Z/n-za-mN-ZA-M/;my$r_a=($ty=~/G/i)?\@g:\@b;push@{$r_a},$ _}}GIFT_GIVING:{print"--- Santa's List Reader ---\nSanta, enter chi", "ld's name, or [Quit] to quit.\n";;my$n="";;;until("All gifts are"=~/ given/x){$n=<STDIN>;chomp$n;last if$n=~/^Quit/i;my($h,$f)=(length($n) %2>0)?("good",$g[rand(@g)]):("bad",$b[rand(@b)]);print"$n was $h th", "is year. Give $f.\n\n\n\nEnter child's name, Santa, or [Quit] to ", "quit.\n"}unless("Grinch"=~/Stole Christmas/){print"\n\n\n\nSanta, ", "you can't quit yet; kids need their toys.\n\n";redo GIFT_GIVING}} __DATA__ Cynl FgngvbaG|FpbbgreG|QbyyG|Creyzbaxf GfuegG|Fuval arj abgrobbxG jbeyq crnprG|Wnpxvr Puna IvqrbG|GevplpyrG|Sver RatvarG|ChcclG Ebggra CbgngbB|Qbt cbbcB|-- ibgrfB|gur syhB|yhzc bs pbnyB|jbezfB ebggra rttfB|ohpxrg bs ibzvgB|Wnpxvr Puna IvqrbB

This one isn't about "figuring it out". Just have fun. Merry Christmas everyone. :)


Dave

Replies are listed 'Best First'.
Re: He's Making a List, Checking it Twice...
by nimdokk (Vicar) on Dec 25, 2003 at 14:46 UTC
    Fun, except for a couple of niggling points: 1) What's wrong with Jackie Chan video's? :-) 2) It wouldn't let me quit and 3) When I entered "Grinch" it just gave me the routine good kid/bad kid message. 2 and 3 were the only real things I noticed that didn't seem to work right on Perl 5.8.0 on Windows 98 SE.


    "Ex libris un peut de tout"
      All of the quirks you mentioned were intentional.
      • Santa couldn't possibly deliver toys to all the boys and girls if he were allowed to quit.
      • Jackie Chan... I dunno why I thought that was funny, but I allowed that gift to go to both good and bad children.
      • Santa would never allow the Grinch to steal Christmas.

      It's just the programming equivilant of a doodle.

      Merry Christmas!


      Dave

        LOL, OK :-)
        I didn't see the Jackie Chan videos going to both, but I guess it depends on which videos we're talking about. I mean Bad kids deserve Fantasy Mission Force, good kids, perhaps Mr. Nice Guy or something :-D. Anyhow, lotta fun regardless.


        "Ex libris un peut de tout"