Anonymous user
Pascal's triangle/Puzzle: Difference between revisions
m
→{{header|REXX}}: added/changed comments and whitespace, re-did the picture of the puzzle.
m (→{{header|REXX}}: added/changed comments and whitespace, re-did the picture of the puzzle.) |
|||
Line 2,188:
=={{header|REXX}}==
<lang rexx>/*REXX program solves a (Pascal's) "Pyramid of Numbers" puzzle given four values. */
/*╔══════════════════════════════════════════════════════╗
║
║
║
║
║
║
║
║
║
║ x y
╚══════════════════════════════════════════════════════╝*/
do #=2; _=sourceLine(#); n=pos('_',_) /* [↓] this DO loop shows (above) box.*/
parse arg
if b=='' | b=="," then b= 11 /*Not specified? Then use the default.*/
if d=='' | d=="," then d= 4 /* " " " " " " */
if mid='' | mid=="," then mid= 40 /* " " " " " " */
if answer='' | answer=="," then answer= 151 /* " " " " " " */
▲ do x =-big to big
do y=-big to big
if x+y \==
end
end
{{out|output|text= when using the default inputs:}}
<pre>
/*╔══════════════════════════════════════════════════════╗
║
║
║
║
║
║
║
║
║
║ x y
╚══════════════════════════════════════════════════════╝*/
x =
</pre>
|