#!/usr/bin/ruby

#
## http://rosettacode.org/wiki/Pascal's_triangle
#

func pascal(rows) {
    var row = [1];
    { | n|
        say row.join(' ');
        row = [1, ^n -> map {|i| row[i] + row[i+1] }..., 1];
    } * rows;
}

pascal(10);
