Pascal's triangle/Puzzle: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 14:
=={{header|Ada}}==
The solution makes an upward run symbolically, though excluding Z. After that two blocks (1,1) and (3,1) being known yield a 2x2 linear system, from which X and Y are determined. Finally each block is revisited and printed.
<lang ada>
<Ada>
with Ada.Text_IO; use Ada.Text_IO;
Line 84:
end loop;
end Pyramid_of_Numbers;
</Adalang>
Sample output:
<pre>
Line 303:
=={{header|Python}}==
{{works with|Python|2.4+}}
<Pythonlang python># Pyramid solver
# [151]
# [ ] [ ]
Line 425:
addlConstraint = { 'X':1, 'Y':-1, 'Z':1, '1':0 }
SolvePyramid( p, addlConstraint)
</Pythonlang>
Output:
<pre>Constraint Equations: