Your job is to write a program that takes a number N as input and outputs all 2-by-N mazes that are solvable.
Output format can be in the form of any two distinct values representing wall and empty - I use
. here but you can use anything. You can have a matrix, array, string, ascii art, whatever is convenient, and it can be horizontal, as shown in my examples, or vertical.
A maze is solvable if it has a path of empty cells (represented here as
.) from the left end to the right end. For example,
is solvable, because you can trace a path (marked with O):
But this is not.
You cannot pass through diagonal gaps, so this is also not:
1: . . . x x . 2: .. .. .. .x .x .. .. x. .. xx x. .. xx ..