Sum and product puzzle: Difference between revisions

m
(→‎{{header|Matlab}}: fixed case of the language name)
Line 124:
 
# checks 1: is TRUE for x plus y, returns TRUE if it is, FALSE otherwose #
PROC all sum decompositiossums have multiple product decompositions = ( INT x plus y )BOOL:
BEGIN
BOOL all multiple p := TRUE;
Line 135:
OD;
all multiple p
END # all sum decompositiossums have multiple product decompositions # ;
 
# 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 sum decompositiossums have multiple product decompositions( x + y ) THEN
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 sum decompositiossums have multiple product decompositions( x plus y ) THEN
FOR x FROM min n TO x plus y OVER 2 DO
INT y = x plus y - x;
3,032

edits