package main type Position struct { x int y int } type Apple Position type Snake struct { head Position tail []Position length int direction int }