Jump to content

Zebra puzzle: Difference between revisions

m
→‎{{header|AppleScript}}: Minor correction in output code.
(Added AppleScript.)
m (→‎{{header|AppleScript}}: Minor correction in output code.)
Line 485:
set solutionCount to (count solutions)
if (solutionCount = 0) then return {zebraOwners:missing value{}, numberOfSolutions:0, solutions:{}}
set owners to {}
repeat with thisHousethisSolution in solutions's first item
ifrepeat with (thisHouse's pet is "zebra")in thenthisSolution
setif owners(thisHouse's endpet tois thisHouse's"zebra") residentthen
set owners's end to thisHouse's resident
end if
exit repeat
end if
end repeat
end repeat
return {zebraOwners:owners, numberOfSolutions:solutionCount, solutions:solutions}
557

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.