Change snake game example to use untyped state machine