### Random Post

### Recent Posts

- Enigma 1084: 1-2-3 triangles
- Tantalizer 466: Diplomacy
- Tantalizer 467: Nine men went to mow
- Enigma 1085: Cut and run
- Enigma 425: Them thar’ Hills
- Puzzle 60: Uncle Bungle gets the last line wrong
- Enigma 1086: Stacking trays
- Enigma 424: A round of fractions
- Tantalizer 468: Shell fire
- Enigma 1087: Egyptian triangles

### Recent Comments

Jim Randell on Enigma 1084: 1-2-3 triang… | |

Brian Gladman on Enigma 1084: 1-2-3 triang… | |

Jim Randell on Enigma 1084: 1-2-3 triang… | |

geoffrounce on Enigma 1631: Joe’s … | |

geoffrounce on Enigma 1626: Pascal’s… |

### Archives

### Categories

- article (11)
- enigma (1,128)
- misc (2)
- project euler (2)
- puzzle (32)
- site news (43)
- tantalizer (34)
- teaser (3)

### Site Stats

- 169,890 hits

I found this quite a fun puzzle to solve programatically.

This Python code makes heavy use of Python’s generator construct (

`yield ...`

) and also uses the`yield from ...`

generator delegation construct, introduced in Python 3.3, so it won’t work in Python 2.7 (although in this case you could just replace the`yield from`

withexpression`for x in`

and it would work). It runs in 2.3s.expression: yield xSolution:The two completed grids are: