Skip to content
Advertisement

Curses snake game not removing cells in linux os

It’s code from a curses tutorial that I’ve been using to get a grasp of it but even though I’ve checked the code multiple times, it’s still not removing the old cells. The guy that wrote the code is on a mac and I’m using linux so would that be a problem?

JavaScript

Advertisement

Answer

The problem seems to be near the lines:

JavaScript

deadcell is always going to be in body, so no cells will ever get cleared.

Try this instead:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement