Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

The Grand Cat Dilation Equation

by perlaintdead (Scribe)
on Jan 11, 2014 at 15:34 UTC ( #1070270=CUFP: print w/ replies, xml ) Need Help??

The basic theory behind this is the more you age the more cats you acquire. I'm asserting that you don't get your first cat until you are at least 19.

print "age: "; my $age = <STDIN>; chomp $age; print int(( ($age - 12) / 10 ) / 0.618), " cats";

Comment on The Grand Cat Dilation Equation
Download Code
Re: The Grand Cat Dilation Equation
by AnomalousMonk (Monsignor) on Jan 11, 2014 at 15:40 UTC

    You don't acquire cats. Cats acquire you.

Re: The Grand Cat Dilation Equation
by perlaintdead (Scribe) on Jan 11, 2014 at 17:54 UTC
    Larry Wall: 7 cats
    Perl: 2 cats
    C: 5 cats
    Java: 0 cats
    Assembly: 8 cats

      Perl has at least seven eight cats without leaving the core or shelling out. And I'm sure I'm missing more than I identified.

      $new = $string_a . $string_b; # 1 cat. $new = join '', $string_a, $string_b; # 2 cats. $new = "$string_a$string_b"; # 3 cats. $new = pack '(A*)*', $string_a, $string_b; # 4 cats. $new .= $_ for $string_a, $string_b; # 5 cats. $new = do { open my $fh, '>', \my $var; print {$fh} $string_a, $string_b; close $fh; $var; }; # 6 cats. $new = List::Util::reduce { $a .= $b } $string_a, $string_b; # 7 cats. $new = sprintf '%s%s', $string_a, $string_b; # 8 cats.

      Dave

Re: The Grand Cat Dilation Equation
by hdb (Parson) on Jan 11, 2014 at 17:55 UTC
Re: The Grand Cat Dilation Equation
by Anonymous Monk on Jan 16, 2014 at 19:00 UTC
    Dogs have owners. Cats have staff.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2014-07-26 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls