[Prolog] Missionaries and Cannibals – M Missionaries & C Cannibals & Boat carries N passengers version

In the missionaries and cannibals problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). […]

Read More

LISP homeworks

Concatenate list1 and list2.

Add one element to the tail of the list.

Delete list’s last element.

Delete list’s head element.

L1 – L2. Return list with elements that are in L1 but not in L2.

L1 intersect L2. Return list with elements that are in both L1 and L2.

Summation […]

Read More