![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Appeared in Volume 6/4, November 1993
Problem statement: a, b, c, d and e are five sticks in a pile; e is the topmost; a lies on top of b but passes under c, and so on. The diagram shows the positions of the sticks. You can pick a stick up only if no other stick lies on top of it.
Write a logic program which determines the order in which you can pick the sticks up.
K Johnson krj@festival.ed.ac.uk
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |