Programming in Prolog
Logic for Problem Solving
ACM SIGART Bulletin
A constraint approach to mastermind in logic programming
ACM SIGART Bulletin
Hi-index | 0.00 |
In the last few issues of SIGART there have appeared (#82, 83 & 85) three articles on Mastermind programmes, the latest of which, by Ehud Shapiro [1], presents a PROLOG version of the best known algorithm for the oldest form of the game-Bull-cow. This paper presents some improvements to this programme and uses it as an example in making some general points about PROLOG. Shapiro's programme is simple and demonstrates the power of PROLOG for implementing a quick solution using a well understood algorithm. My comments concern some changes to assist readability, to improve generality, and to develop a different, more efficient derivative of the algorithm.