Solving a logic puzzle using Prolog

前端 未结 5 554
鱼传尺愫
鱼传尺愫 2020-12-13 16:27

The criminal is one of A, B, C and D.

A says: \"It\'s not me\"
B says: \"It\'s D\"
C says: \"It\'s B\"
D says: \"It\'s not me\"

5条回答
  •  抹茶落季
    2020-12-13 16:55

    A similar problem and corresponding solution can also be found here:

    https://github.com/LogtalkDotOrg/logtalk3/blob/master/examples/puzzles/jam_thief.lgt

    Like the solution posted by Kaarel, is possible to request a justification/explanation for the solution found.

提交回复
热议问题