by Max Foster: L6 Age ~16


Max has commented thoroughly his prodigious, highly impressive console program. He demonstrates command of a wide range of Pascal language features such as one- and two-dimensional arrays, the full range of selection and iteration constructs often with several levels of nesting, file handling, string manipulation, records, classes and objects, random numbers, c-type syntax for operators and the use of the Simple Directmedia Layer for music. The 3000+ lines of code include functions and 86 procedures! The procedures have up to eight parameters for versatility. Unsurprisingly after all of this, Max is the first student to supply an icon for his program.

Remarkably, Max has achieved effective graphics with the use of only the crt unit without graph or wingraph. The following screenshots show a map in action and a confrontation.

Map in action

Map in action



Download here a zip file containing the code (pascalpokemon.txt), the map files (map1.txt, map2.txt and map3.txt), the icon (PascalPokemon.ico) and the sounds folder. You should unzip the files so that the three map files, the icon and the sounds folder are in the program folder. In order to hear the music, you will need to uncomment the relevant lines and use SDL files. (See Getting Started with SDL for download details). The program uses the crt unit, so compile it using Lazarus.

You will have the opportunity to rename the characters but press return to accept the default names. Use the wasd, arrow and RETURN keys to control the game.

Click on the first link below to see all the code of the Windows version in one large html file. Be prepared for a significant delay if you have a slow system. The second link takes you to a cross-platform version, kindly supplied by Max in February 2013 after leaving school to become a professional programmer. It compiles and runs on the Raspberry Pi, and is at its best under the Arch Linux operating system which implements the CursorOff routine. Max supplied this latest zip file with the code and maps. This version also works on a Mac and Max includes the Mac map files in a separate folder.

It is instructive to compare the two versions to see, for example, how Max has handled the keyboard input by assigning values to the Windows constants such as VK_UP.

Programming - a skill for life!

NetworkChat, PascalPokemon and MrSnugglekins by Max Foster