Re: pp Pascal (#84)

Kelly wrote:

puts (0…ARGV.first.to_i).inject([[1]]) { |a,x|

puts (0…(ARGV.first||“6”).to_i).inject([[1]]) { |a,x|

just a minor pick for easy cutnpaste then run. defualt of 6 rows.

cool hack, btw.
kind regards -botp

a.unshift a.first.inject([0,[]]) { |b,y|

[y,b.last << (b.first + y)]

}.last + [1]

}.inject([]) { |c,z|

next [z[z.length/2].to_s.length*2,z.length,""] if c.empty?

[c[0],c[1], { |j|[0])




This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs