4-rings or 4-squares puzzle: Difference between revisions
Content deleted Content added
m →{{header|Phix}}: marked p2js compatible, now part of distro |
→{{header|XPL0}}: Recursive solution. |
||
Line 6,162:
=={{header|XPL0}}==
<lang XPL0>
proc Rings(Level);
int Level; \of recursion
int
[Digit(Level):= D;
▲for A:= Lo to Hi do
if Level < 7-1 then Rings(Level+1)
else [
if Temp = Digit(1) + Digit(2) + Digit(3) and
Temp = Digit(3) + Digit(4) + Digit(5) and
[
];
];
CrLf(0);▼
];
[
Low:= 1; High:= 7;
Rings(0);
▲CrLf(0);
Low:= 3; High:= 9;
Rings(0);
CrLf(0);
Show:= false;
Low:= 0; High:= 9; Count:= 0;
Rings(0);
IntOut(0, Count);
CrLf(0);
]</lang>
Line 6,220 ⟶ 6,219:
9 6 5 4 3 8 7
2860
</pre>
|