My first game: Snake2K1 in Turbo Pascal

26 January 2008 Tags  ,

snk2kp1

In Year 9 at Melbourne High School, the programming (Software Design, I think it was called) subject was Visual Basic 5 or 6, but the book the school has produced for it was based on VB 3 or 4, with screenshots from Win3.11 days (I think?). There were errors upon errors, which as a good student (going through awkward teenage years, who could do with the ego boost from being right) reported each mistake, correcting most of them. The subject was one short semester long, and the second semester students benefited from my fixes - the manual they received had a different colour cover signifying it had updated screenshots, and the code was correct. I enjoyed and dreaded these classes. I was a better programmer than any other in the class, but the subject bored me so much that my academic performance in the subject suffered.

Year 10 was an interesting year for me, both academically and personally. That year I had several weeks off school (or more importantly, off my feet) due to a rather sizable operation on my feet to fix (which it did) chronic ingrown toenails, and later in the year my chronic cough returned which ended the year for me. Before all of that happened however, the programming unit this year involved Turbo Pascal 6. While not the most powerful language, it was a fantastic teaching language. Our "group"/major assignment was to create a basic game. I use the term "group" loosely, as the guy I was partnered with played cards all class, such that I wrote all of the code (except the unit included from Reinout Raymakers).

My assignment was Snake2K+1 (yeah, fantastic title…), which I've recently rediscovered the source code/compiled exe.

It weighs in at about 500 lines of code (from memory it was nearly double the rest of the class which was made up mostly of hangman) and had more colours than the teacher said was possible (he said 256 colours was the limit of Turbo Pascal…mine can handle up to 32,000 colours).

Back in those days, Melbourne High ran entirely off floppy drives (despite having network share capability). When I finally decided to remove all floppy disk drives from the house, I went through and backed everything up onto hard drives. Despite doing that, I had hidden the source code, and it wasn't until recently that I found it while backing up another computer to my wife's laptop.

The next challenge was to get it to run under Vista, which I took a gamble on…and got it to work under DOSBox, albeit with major speed issues. I'll look for a Turbo Pascal compiler so that I can get it running at a decent speed, but for now…

snk2kp2

Download

Source Code & Executable

Don't forget to use DOSBox to get it to run!


Comments

Trackbacks / Pingbacks

Comments are closed