dom96 / snake

A little snake game in Nim
http://picheta.me/snake/
MIT License
210 stars 9 forks source link

Ouroboros' unusual introspection habits #8

Open Tallefer opened 7 years ago

Tallefer commented 7 years ago

A quick clockwise U-turn was expected, but nim-snake This is not supposed to happen, right? There is also a possibility that it is a side effect of a temporary slowdown or/and disconnection.

dom96 commented 7 years ago

Yeah, this shouldn't happen. I'm guessing it's not easy to reproduce though :\

Tallefer commented 7 years ago

But the main question is - what to blame? Is it Nim compiler or this game code (less likely IMO) or is it browser's VM async quirks? What do you think? Is it even important at all to raise this question?

dom96 commented 7 years ago

It's most definitely some race condition. I don't think it happens very often though, does it?

Tallefer commented 7 years ago

Yup, same conditions are not too common. Well, I can only try to reproduce it at some point, but as I said - probably related to disconnection and freeze which were occurring at that very moment, Memory was almost full, too. So browser in general was chugging a lot then.

dom96 commented 5 years ago

This might be fixed now :)

soypat commented 5 years ago

I managed to reproduce python introspection by making a fast counter-clockwise turn (uparrow->leftarrow) while transiting the top row. Version: https://nim-lang.org/features.html

matomatical commented 2 years ago

^ The same issue affects me. I think this affects the topmost and leftmost rows and I could reproduce it reliably a few times. I already opened a new issue describing the problem, sorry for the double-up: #11.

(Although it does seem like a distinct issue, because (1) it's reproducible (2) it affects the whole leftmost and topmost rows (3) rather than requiring fast turns it seems there is a whole time step in which the head is missing---all of this suggests some kind of off-by-one-error in the game logic for wraparound at the left/top side, rather than a race condition)