Sum and product puzzle: Difference between revisions
m
→{{header|ALGOL 68}}: Fix typos
(→{{header|Matlab}}: fixed case of the language name) |
m (→{{header|ALGOL 68}}: Fix typos) |
||
Line 124:
# checks 1: is TRUE for x plus y, returns TRUE if it is, FALSE otherwose #
PROC all
BEGIN
BOOL all multiple p := TRUE;
Line 135:
OD;
all multiple p
END # all
# checks 2: is TRUE for x times y, returns TRUE if it is, FALSE otherwose #
Line 147:
# x, y is a product decomposition of x times y #
IF candidate[ x, y ] THEN
IF all
multiple p +:= 1
FI
Line 167:
# Statement 1: S says P doesn't know X and Y #
FOR x plus y FROM min n TO max n + min n DO
IF NOT all
FOR x FROM min n TO x plus y OVER 2 DO
INT y = x plus y - x;
|