Tom Armitage schrieb: > OK, so this isn't going to win many prizes for speed or correctness > (my alignment sucks as the triangle gets bigger) but at least I tried. > Second RubyQuiz entry, from a complete numpty... > > # Pascal's triangle - Rubyquiz # 84 > > rows = ARGV[0].to_i > @output = [] > > puts "Pascal's triangle with #{rows} rows" > > count = 0 > > 1.upto(rows) do |i| > if count == 0 > [...] just some short remarks: 1) you don't use i 2) count is always i-1 so you may a) remove |i| or b) remove count and use i-1 or c) change the loop to 0.upto(rows-1) do |count| and remove all 'count = count.next' lines. (and the 'count = 0' line) fell free to ignore, happy coding. Simon