Prolog - recursing down family tree

后端 未结 3 1194
孤城傲影
孤城傲影 2021-02-10 20:19

I am trying to write a Prolog program that will print out the male successors of British Royalty in order. My attempt so far:

son(elizabeth, charles).
son(charle         


        
3条回答
  •  生来不讨喜
    2021-02-10 20:53

    Your rule set looks good to me, it's giving you the right results, it's just printing them as it deduces them, which makes the order seem incorrect. Work through the results on paper and you will likely get a similar result.

提交回复
热议问题