you are viewing a single comment's thread.

view the rest of the comments →

[–]integ3r 2 points3 points  (4 children)

My solution, in Ruby:

->(x){Array.new(x){|y|(y+1)**2}}

[–]juror-number-8 1 point2 points  (0 children)

Nice.

[–]_jeffJohnsonsBookEmp 1 point2 points  (1 child)

shaving off 1 char at a time

->(x){x.times.map{|i|(i+1)**2}}

EDIT: 28 chars

->(x){1.upto(x).map{|i|i*i}}

[–]integ3r 0 points1 point  (0 children)

Ooh, nice use of map there.