Twelve statements: Difference between revisions

m
→‎{{header|AppleScript}}: More efficient postulation.
m (→‎{{header|AppleScript}}: Bad edit corrected)
m (→‎{{header|AppleScript}}: More efficient postulation.)
Line 426:
set statement1Truth to (nStatements = 12)
repeat with stmt from 1 to nStatements
set end of o's o's posits to missing valuefalse
tell (statements's item stmt's words) to set statement1Truth to ¬
((statement1Truth) and ((count) > 1) and (beginning = stmt as text))
Line 432:
set output to {}
set firstIteration to true
repeat with |try| from 0 to (2 ^ nStatements) - 1)times
-- Postulate answer:
if (firstIteration) then
repeat with stmt from 1 to nStatements
set o's posits's item stmtfirstIteration to (|try| mod 2 = 1)false
else -- "Increment" the set'posits' |try|boolean toarray |try| div 2binarily.
end repeat with stmt from 1 to nStatements
set o's posits's item stmt to (not (o's posits's item stmt))
if (result) then exit repeat -- No carry.
end repeat
end if
-- Test consistency:
557

edits