So in the tag prolog someone wanted to solve the "the giant cat army riddle" by Dan Finkel (see video / Link for description of the puzzle).
Since I want to improve in answer set programming I hereby challenge you to solve the puzzle more efficient than me. You will find my solution as answer. I'll accept the fastest running answer (except if it's using dirty hacks).
Rules:
- hardcoding the length of the list (or something similar) counts as dirty hack.
- The output has to be in the predicate
r/2
, where it's first argument is the index of the list and the second its entry. - Time measured is for the first valid answer.