Pretty cool! I used backtracking for a very similar layout problem: generating word searches. I used C# for that.