Anonymous user
Pascal's triangle/Puzzle: Difference between revisions
m
→{{header|Ruby}}
(add Ruby) |
|||
Line 590:
=={{header|Ruby}}==
<lang ruby>require 'rref'
pyramid = [
Line 633:
for eqn in reduced
if
elsif eqn[0] == 0 and eqn[1] == 1 and eqn[2] == 0: y = eqn[3]▼
elsif eqn[0
elsif eqn[2] == 1: z = eqn[3]
▲ fail "no solution? #{equations.inspect} ==> #{reduced.inspect}"
end
end
|