### Random Post

### Recent Posts

### Recent Comments

geoffrounce on Enigma 440: Three X | |

Jim Randell on Enigma 1588: As easy as 1… | |

Jim Randell on Enigma 440: Three X | |

geoffrounce on Enigma 1106: Not a square… | |

Jim Randell on Tantalizer 458: Knifemen |

### Archives

### Categories

- article (11)
- enigma (1,156)
- misc (2)
- project euler (2)
- puzzle (39)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,401 hits

Advertisements

I thought this sounded like a tricky one to code up, but when I set about it it was actually surprisingly simple, but still fun. The following recursive Python approach runs in 150ms.

Solution: There are 5 different combinations.Instead of considering two different types of card and worrying about their rotations and determining the interior and exterior of shapes I instead considered 12 possible tiles which take all possible arrangements into account.

The edges of the tiles are split into two segments and labelled either 0 or 1 (for “0utside” and “1nside” to distinguish the exterior and interior segments). I then consider a 6 x 8 grid where the perimeter is filled with empty tiles that consist entirely of exterior edges. The problem is then simply to fit tiles into the grid so that the edges match up. And find solutions where the interior (coloured in) area is 60 (measuring in eighths of squares, so the entire 4 x 6 grid has an area of 192).

It turns out the are 59 different grids (although fewer if you eliminate duplicates grids by symmetry, and fewer still if you eliminate duplicate grids that use the same shapes, but rearranged).

It turns out that each of these grids is composed of the following 15 different enclosed shapes.

and here are example solutions using, 4 type A and 20 type B cards (there are 4 such grids):

6 type A and 18 type B cards (there are 4 such grids):

8 type A and 16 type B cards (there are 22 such grids):

10 type A and 14 type B cards (there are 20 such grids):

12 type A and 12 type B cards (there are 9 such grids):

The following code is augmented to produce all grid patterns (regardless of area), and attempt an ASCII art representation of the layout:

The maximum enclosed area you can make is 13.5 tiles, using a grid that uses 12 type A and 12 type B cards. It looks like this:

Brilliant, Jim. Just the sort of detailed analysis we appreciate, as opposed to the one-line answers published in the magazine.