Snake is always been for me my hello world program. I implemented it in many different languages Basic, C, C++, Java and Javascript. But I didn't limited myself at high level languages. At the second year of university (something like 7 years ago) I actually implemented it entirely in assembler MASM in roughly 600 lines of code. It is so old that the variables and the comments are in italian :)
Unfortunately I can't run it (and provide a screenshot of the game) because is using a library called compatib that I am not able to find. Friends can confirm that this code actually worked at the time :)
This is the main procedure:
This is the game loop:
This is the procedure that print the snake on the screen:
This program is very old but I still remember the feeling after I implemented it in one evening and in particular the satisfaction of the following day when I showed it to my class mates. They were shocked!
This is what I call fun!
great job Angel :-)
ReplyDeleteI'm looking and enjoy :-)