The beginning
The first Snake-type game was Blockade, an arcade cabinet from Gremlin Industries. Two players steered arrows that left a solid wall behind them; you lost by running into a wall, yours or theirs. It was cloned almost immediately — Atari’s Surround followed on the VCS in 1977.
The single-player version, the one where you eat something and get longer, arrives later. Peter Trefonas published Worm for the TRS-80 in CLOAD magazine in 1978, and by 1982 the food-eating form was everywhere: Snake Byte from Sirius Software, and Nibbler in the arcades.
This is the lineage Nokia itself points to. It is a better story than sole invention.