LOGIC4FUN

Cats And Dogsexpert series

This is a problem that can be coded efficiently, so that the solver gets its solution in a fraction of a second, or inefficiently so that it times out. Experiment with it.

Cats And Dogs image

The diagram shows a line of seven “spots”, each of which except the centre one is occupied either by a cat or by a dog. At any stage, an animal which is next to the blank spot may move onto it, except that cats may only move to the right and dogs only to the left. A cat or dog may also jump over one other animal to get to the blank spot. Again, cats may jump only to the right and dogs may only jump left.

Find a sequence of moves that leads from the upper configuration to the lower configuration in the image above.

This puzzle is not my invention. One of my kids found it on a web site of games.* Though it now seems to have disappeared into the remote depths of the Internet, I’d be happy to acknowledge its author here. Anyone who knows more about its origins, please contact me.

* To try out your solution with nice graphics, see this site” (well, the cats and dogs are now frogs, but—you get the idea). Alternatively, try this one . Thanks to Logan Corry for these pointers.

Solver

Please log in or create an account to use the solver.
Save Title:
Saved Solutions
Name Time saved
Class Submissions
Name Time submitted
  
Powered by:                 

  Auto Parser Results

No errors found.