Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Following to my previous node Perl Lazy Surfing i decided to expand that idea and satisfy the needs of those who, being forced to live in places where are no waves, decided to surf the asphalt...here's my Perl Lazy Skateboarding: more specialities, more detail, and a little stupid childish obfu to print out a funny message in case of a highscore!
Being not a serious obfu it must be taken "as is", just not to reveal the surprise.
Also added a curious formatting to remind a skateboard. What to say? Useless and funny as every nerdish thing...but after all one of the virtues of the Perl programmer is Laziness!!!

Update:
I corrected the "300" Hiscore limit to "600"!!!
You are WAY too lucky!!!

Enjoy!

#!/usr/bin/perl -w use strict; # ain't nothin' to do??? # Go Perl Lazy Skateboarding!!!! my $deck = int rand 3; my $wheels = int rand 3; my $trucks = int rand 3; my $spot = int rand 3; my $risk; my @d = ( "a Powell Street Deck","an Old School Board", "a Downhill Longboard"); my @w = ( "Small Hard Wheels","Medium Sized/Tough Wheels", "Large Soft Wheels"); my @t = ( "and Narrow Trucks","and Regular Trucks", "and Wide Trucks"); my @s = ( "Randomly Freestyling", "On the Ramp", "Speeding Downhill"); system 'clear'; print "\n-=# Welcome to Perl Lazy Skateboarding #=-\nby Sigmund \n\n"; print "You got:\n"; sleep 1; print $d[$deck]."\n"; sleep 1; print $w[$wheels]."\n"; sleep 1; print $t[$trucks]."\n"; sleep 1; print "and you decided to go ".$s[$spot]."\n"; sleep 2; $deck *= 2; if (($deck <=2 && $spot <=1)||($deck >=2 && $spot >=1)) { $risk = $deck + $spot; } else { die "Impossible Task, Man! You must be fool !!!\n\n"; } my @comment = ( "Great Nineties ! Smart Guy !", "Risky Business, Man!", "A Man from the Eighties wanna be modern ?!?", "Nothin' to say...Eighties' deck, Eighties' Soul !!!", "You already tried killin'yourself fifteen years ago !", "Got Nostalgy of the 60's ?", "Perfect. That ain't Surf, but Speed gets ya high as well !!" ); print $comment[$risk]."\n"; my @stricks = ("","Ollie","Kickflip","Wheelie", "Streetplant","Grind","Boneless"); my @rtricks = ("","Disaster","Axle-Stall","Rock&Roll", "Handplant","Slide","Airwalk"); my @dtricks = ("","Carve","Drop Knee","Board Walk", "Hang Ten","Nose Wheelie","XXX"); my $control = int rand 7; $wheels *= 10; $trucks *= 10; my $total = 0; my $score = 0; sub street { $score = (45-$wheels-$trucks) if $risk == 0; $score = (55-$wheels-$trucks) if $risk == 2; while ($control != 0) { $total += $score; print "Hey, good ".$stricks[$control]."\n"; sleep 1; $control = int rand 7; } print "You Crashed!\n"; } sub ramp { $score = (25+$wheels-$trucks) if (($risk == 1) || ($risk == 5)); $score = (35+$wheels-$trucks) if $risk == 3; while ($control != 0) { $total += $score; print "Hey, good ".$rtricks[$control]."\n"; sleep 1; $control = int rand 7; } print "You did fall!\n"; } sub downhill { $score = (5+$wheels+$trucks) if $risk == 4; $score = (15+$wheels+$trucks) if $risk == 6; while ($control != 0) { $total += $score; print "Hey, good ".$dtricks[$control]."\n"; sleep 1; $control = int rand 7; } print "You Slipped!\n"; } sub bigscore { my @gr =("#"x 80 ,"\n" ,"#" x6," "x14,"#"x8," "x8,"#"x6," "x7,"#"x7, " "x6,"#"x18,"\n","#"x3," "x21,"#"x5," "x6,"#"x6," "x6,"#"x 6,"", " "x5,"#"x3," "x6,"#"x13,"\n","#"x3," "x6,"#"x7," "x9,"#"x 6,"" , " "x5,"#"x4," "x4,"#"x8," "x4,"#"x7," "x5,"#"x12,"\n","#" x5,""x3, " "x5,"#"x11," "x5,"#"x5," "x5,"#"x3," "x3,"#"x10," " x4,"#" x 7, " "x4,"#"x13 ,"\n","#"x8," "x6,"#"x18," "x9,"#" x12," "x4,"#"x5, " "x3,"#" x15 ,"\n","#"x11," "x6,"#"x16," " x 7,"#"x 15,"#" x 0, " "x9,"#"x16,"\n","#"x14," " x9,"#"x 10 , " " x 9, "#"x 11, " "x4 ,"#"x4," "x5,"#"x14, "\n","" ,"#"x20 ," "x7,"#"x6, " "x5 ,"#"x2," "x4,"#"x8," "x 4,"#"x7," " x4,"#" x 13, "\n","#"x5," " x2,"#"x15," " x6,"#"x4," "x5,"#" x 4," "x5,""x 79, "#"x7," "x4,"#" x6," " x5,"#"x12,"\n","#"x5," "x7,"#"x8," "x 6, "#"x6," "x 4, "#" x6," "x6,"#" x5," "x5,"#"x3," "x5, "#"x14,"\n","#" x7, " "x 16,"#" x7," "x7,"#"x7," "x 7 ,"#"x4, " "x9,"#"x16,"\n","#"x80, "\n","#"x21," "x3,"#"x16," "x3,"#"x9, " "x9,"#"x19,"\n","#"x3," "x4,"#"x3," "x3,"#", " " x3,"#"x3," "x 10, "#"x10," " x3,"#"x8," "x3, "#" x 26 ,"\n","#"," "x2,"#" x 4 , " "x2, "#"," "x 4,"#" x2," "x2,"#"x4," "x3,"#"x3," "x8,"#"x13," "x4,"#"x27, "\n","#"," "x2,"#"x 4 , " " x 2 ,"#"," " x3,"#"x9," "x4,"#"x7," "x5, "#"x3," "x3,"#"x5," "x3,"#" x5," "x7,"#"x 16,"\n","#"x2," "x5,"#"x3, " "x3,"#"x10," "x3,"#"x9," "x3,"#"x3," "x3,"#"x5," "x12,"#"x19,"\n", "#"x23," "x4,"#"x8," "x4,"#"x3," "x3,"#"x4," "x5,"#"x26,"\n","#"x24, " "x3,"#"x7," "x4,"#"x4," "x3,"#"x5," "x4,"#"x26,"\n","#"x 24," "x4, "#"x4," "x4,"#"x6," "x3,"#"x7," "x5,"#"x4," "x5,"#"x14,"\n","#"x 24, " "x9,"#"x5,"#"x4," "x3,"#"x9," "x10,"#"x16,"\n","#"x71,"#"x9,"\n"); print "You Made a High Score! In three seconds you'll see the secret message!!!\n"; sleep 3; foreach (@gr) { print; } } my @sp = ("street","ramp","downhill"); eval $sp[$spot]; print "Today's Score is: ".$total."\n\n"; bigscore if $total > 600;


SiG

perl -le 's ssSss.s sSsSiss.s s$sSss.ss .$s\107ss.print'

In reply to <b>Perl Lazy Skateboarding</b> by Sigmund

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others cooling their heels in the Monastery: (4)
    As of 2024-10-03 22:40 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (42 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.