This reminds me of the mass market hi-q puzzle although this puzzle probably inspired the hi-q cross design. I was never able to solve it as A kid but later wrote a 6502 program to try to solve it. I toggled char's on the monitor to see if it was running or off in never never land ( relative jmps are murder). After 10, 20 , 40 ?? Minutes it stopped. It hadn't crashed. I dumped the memory. It was the solution!
Prolog seemed cool when i saw it but life in IT drudgery took over.