This was actually just a school homework assignment. I was among the Guinea Pigs trialing this new italian high school course of study (it consisted in replacing latin classes with computer science). Must say it was way more fun than I expected it to be.
The code is relatively short and simple. Pascal has this nice feature which forces separation between declaration and implementation. This is why i think this is a great language to start things off when it comes to coding. Worse idea you could have is to start with something like Javascript or Python or anything that is a dynamically typed language.
Move with wasd
I was personally glad the program just ran without issue on the online emulator, because the code is a right mess. But i think it’s fine given its purpose was just pioneering coding.
Interesting trivia - the game logic is severely flawed, the snake grows at every tick... True Snake fans know that you grow only when you eat the apple. However this is one of the fascinating aspects of computer science: everything follows logic, even bugs. I clearly remember trying to make my game follow the same rules as the standard one. But at some point, partly because of exhaustion, partly because i thought it was more fun, i kept it this way.
Bugs are a difficult thing to pin down. They are merely unexpected, unplanned outcomes. That usually means bad news. Here it meant good news. I guess the message i want to pass is that it is nice to fabricate something which is perhaps random and unexpected, just to be able to explore it and learn from it.
It is also something quite unique, there’s not many builders who would want to test random structures just to “get inspired”; materials cost and any architect would laugh at you if you suggested this. In the digital realm, however, this is instead a total net-positive win-win situation. So go make some bugs and be amazed at how smart they actually are.