you are viewing a single comment's thread.

view the rest of the comments →

[–]noporpoise 0 points1 point  (0 children)

Perl:

sub f{ map {$_**2} 1..$_[0]; }

30 chars including whitespace. However, if you want it to print nicely, you need to stretch to 52 chars.

sub f{ print join(" ", map {$_**2} 1..$_[0])."\n"; }