One time, debugging a Slither io knockoff, I had a similar issue with bizarre, unpredictable movement patterns. It turned out to be a rogue variable influencing the snake's speed – a truly unsettling and almost comical bug in its execution!
https://slitherio.onl
https://slitherio.onl