Everybody in Cornwall has a gull story.

Mine involves a pasty, a harbour wall at Newquay, and roughly one second of inattention. The pasty was warm. It was mine. Then it was not, and I was left holding the corner of a paper bag with the specific facial expression of a man who has just been outwitted by a bird.

So here is a risk calculator for it, presented with all the scientific rigour it deserves, which is none.

What it weighs

Eight factors, each worth a different amount, because they genuinely are worth different amounts.

Visible, uncovered food is the big one at twenty-five per cent, for the obvious reason. Being within sight of a harbour, prom or beach is twenty, because that is where the trained population lives. The holy trinity — pasty, chips, ice cream — is fifteen.

Then the tens. Being alone, with no human shield. The summer holidays, when the birds have spent six weeks refining their technique on tourists. Eye contact, which is a declaration of war and is treated as such. And looking at your phone mid-chip, which is not a risk factor so much as an invitation.

One factor subtracts. Being indoors with the door shut is worth minus fifteen, and it is minus fifteen rather than minus everything because you have all seen what happens when the door does not shut properly.

Why it never says zero

The baseline is five per cent and the ceiling is ninety-nine.

Those are both deliberate. There is no situation in Cornwall in which the risk of gull interference is genuinely nil, and there is no situation in which it is certain, because occasionally — very occasionally — nothing happens and you simply eat your lunch.

Ninety-nine per cent gets you the verdict about how the pasty was never truly yours. It belonged to the sky. I stand by that.

The serious footnote

Herring gulls are a red-listed species in the UK. Their numbers have fallen substantially, which is a genuinely odd fact to sit alongside the lived experience of being mugged by one outside a bakery.

They are here in numbers in town because we made towns extremely good places to be a gull, and then we got annoyed about it. Do not feed them, obviously — that is what trains them. But the joke is on us rather than on them.

Where it runs

In your browser. It is eight checkboxes and some arithmetic; there is nothing to send anywhere, and it would be a strange thing to build a server for.