# dhermes/bossylobster-blog

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
51 lines (41 sloc) 1.75 KB
```---
title: How Many Ways to Make a (Football) Score
description: Describing all the ways a football score can be obtained
date: 2016-01-10
author: Danny Hermes (dhermes@bossylobster.com)
tags: Programming, JavaScript, Football
slug: how-many-ways-to-make-a-football-score
use_open_graph: true
use_schema_org: true
social_image: images/generic-football.png
github_slug: content/2016-01-10-how-many-ways-to-make-a-football-score.md
---
```

While watching today's Seahawks-Vikings game, my wife asked:

How did the Seahawks score 9 points? Did they get a field goal and miss an extra point after a touchdown?

I had been head down coding and didn't know the answer. I quickly jotted down the possibilities (like solving the coin-change problem with coins of value 2, 3, 6, 7 and 8) and told her it could be one of four outcomes:

• Field Goal (3), TD with missed PAT (6)
• 3 Field Goals (3 x 3)
• Safety (2), TD (7)
• 3 Safeties (3 x 2), Field Goal (3)

I decided it'd be fun to make a tool to answer this question for any score (not just 9). Enjoy

### Give me a score, I'll count the ways

Score:
1. 1 x Field Goal, 1 x TD with missed PAT
2. 3 x Field Goal
3. 1 x Safety, 1 x TD
4. 3 x Safety, 1 x Field Goal
<script src="/js/scoring_possible.js" type="text/javascript"></script>