So I decided to write an application to solve the Zebra Puzzle, by solving this type of problem in general. In Pharo, of course.
I worked out a few basic algorithms for making deductions and inferences, and coded them, along with tests, in Pharo 8. Now I've reached the point of having a working "proof of concept" or prototype. It can't (yet) solve the Zebra Puzzle without some "human assistance", but it does keep track of the solution state as it progresses, it handles the bookkeeping, makes the basic deductions/inferences, and produces reports. And I've used it to quickly solve the Zebra Puzzle. I coded the solution as a separate class/method, with extra rules inserted that I was able to infer by iterating to partial solutions, so that it solves the entire thing. It will interesting to develop the remaining algorithms, and it would be nice to eventually create a nice, interactive user interface for it as well. Since I want to fashion this into an intermediate-level tutorial, I need feedback on what I have so far. I don't want my inexperience to lead to me teaching the wrong techniques, etc. to other developers who are learning Pharo. What I have can no doubt be improved, but I need to hear from the master craftsman in this community what parts are compromised and how (and why) it can be made a better example of "how to program in Pharo" properly. If anyone has the time and is willing to help, the code (complete with class & method comments, test classes/methods, and the Zebra Puzzle example) is here: https://github.com/tbrunz/logic-puzzle and I'm available to answer questions about it, of course. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html