Pascal's triangle/Puzzle: Difference between revisions

m
→‎{{header|REXX}}: aligned some statements, added wording to the REXX section header.
No edit summary
m (→‎{{header|REXX}}: aligned some statements, added wording to the REXX section header.)
Line 2,355:
 
=={{header|REXX}}==
This REXX version also displays a diagram of the puzzle.
<lang rexx>/*REXX program solves a (Pascal's) "Pyramid of Numbers" puzzle given four values. */
/* ╔══════════════════════════════════════════════════╗
Line 2,377 ⟶ 2,378:
if mid='' | mid=="," then mid= 40 /* " " " " " " */
if answer='' | answer=="," then answer= 151 /* " " " " " " */
big= answer - 4*b - 4*d /*calculate BIG number less constants*/
do x=-big to big
do y=-big to big
if x+y \== mid - 2*b then iterate /*40 = x+2B+Y ──or── 40-2*11 = x+y */
do z=-big to big
if z \== y - x then iterate /*Z has to equal Y-X (Y= X+Z) */
if x+y*6+z==big then say right('x =', n) x right("y =",n) y right('z =',n) z
end /*z*/