### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,314)
- misc (3)
- project euler (2)
- puzzle (78)
- puzzle# (21)
- site news (54)
- tantalizer (80)
- teaser (7)

### Site Stats

- 217,165 hits

Programming Enigma Puzzles

31 July 2019

Posted by on **From New Scientist #1068, 8th September 1977** [link]

A lot of people have been of the opinion for some time that in football competitions some importance should be attached to the number of goals scored as well as to the actual result of the game. It is hoped that this will lead to more goals and therefore to more attractive games.

Three local teams of my acquaintance have been experimenting on these lines. The have had a competition in which they all played each other once, and they have awarded ten points for a win, five points for a draw, no points of course for a loss, and one point for each goal scored.

As a result of this competition one team scored 16 points, the second scored 18 points, and the third scored 10 points. It was interesting to notice that at least one goal was scored by both sides in every match.

What was the score in each match?

[puzzle17]

%d bloggers like this:

This Python program works by looking at the possible match outcomes, and calculating the non-goal points awarded, from which we can determine the “goals for” for each team. It then chooses “goals against” values with the same sum, and looks for values that give viable match scores. It uses the [[

Football()]] helper class from theenigma.pylibrary. It runs in 102ms.Run:[ @repl.it ]Solution:The scores in the matches were: A vs B = 1-2; A vs C = 5-4; B vs C = 1-1.