阅读背景:

如何在prolog中比较两个列表,如果第二个列表是由列表1的每个其他元素组成,则返回true?

来源:互联网 

I would solve it by comparing the first index of the first list and adding 2 to the index. But I do not know how to check for indexes in prolog. Also, I would create a counter that ignores what is in the list when the counter is an odd number (if we start to count from 0). Can you help me? Example: everyOther([1,2,3,4,5],[1,3,5]) is true, but everyOther([1,2,3,4,5],[1,2,3]) is not.I would solve it by comparing the first index o




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: