### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,123)
- misc (2)
- project euler (2)
- puzzle (31)
- site news (43)
- tantalizer (31)
- teaser (3)

### Site Stats

- 168,355 hits

Programming Enigma Puzzles

3 January 2012

Posted by on **From New Scientist #2773, 14th August 2010** [link]

Joe asked Penny to find the honey in the honeycomb. The number in each cell indicates how many of the adjoining cells contain honey.

Numbering the cells in the centre row 1 to 8 from left to right, which numbered cells contain honey?

[enigma1608]

Advertisements

%d bloggers like this:

The following Python program runs in 30ms and finds the solution, although it is not a generic engine for solving similar problems. It uses a simple strategy to fill out the unknown cells, and it turns out that by considering the possibilities for the cells surrounding the top-left cell this strategy is sufficient.

It would be more satisfactory to adapt my Sudoku solving code to work on this puzzle, but as the code below does its job I didn’t do that.

Solution:Cells 1 and 7 contain honey.