Programs

Links to table sections: [Console] [Crt] [Wingraph] [SDL] [Oxygene] [Smart Mobile Studio]

This is a growing collection! Take a look, be inspired then contribute yourself!

Now that we have a wide range of Pascal programs, we have arranged them and collated their details in the table below. Programs towards the top of the table tend to be more straightforward, with few if any added requirements, and should be appreciated by beginners. For these programs we have noted commonly used language features such as loops and selection statements so that you can use them for reference. Programs towards the bottom of the table are advanced and show what can be achieved with the Pascal language by keen, talented students. These programs also contain many examples of common features, but we note only their more advanced features for reference purposes.

Select the programs from (i) the left panel, (ii) the links in the table or (iii) the list below the table. Compile programs requiring the Crt unit using Lazarus or see how to download and use Crt in Delphi 7 in our Graphics tutorial.

Our extension website, which will feature selected student programs in languages other than Pascal, has a Smart Mobile Studio demonstration that allows you to select the programmer then follow links back to the start page of the chosen program on this website.

Name Programmer Description Features Requirements Classification
ChristmasProg Mitchell Weiss Christmas tree decorations If statements, char variables, Writeln, Readln   Visual effect
Rocket Alkesh Gajjar Ascending rocket Integer variables, for loop, Sleep, Writeln   Visual effect
RockPaperScissors, also available as Oxygene version Hasaan Ausat Pascal version of the guessing game Integer variables and char variable, repeat loop, if statements, Random   Game
Roulette, also available as Oxygene version Ayotunde Betting against the casino on numbers and red/black Procedures, integer and real variables, repeat loops, if statements, Random   Game
SUVAT Alkesh Gajjar Physics calculations Integer and real variables, arithmetic operators, formatting of real numbers, Sqr   Educational
BigFibonacci Felix Thompson Outputs thousand digit Fibonacci number Arrays of integer, excellently commented   Educational
Cars Omar Hamid-Chohan Selects web pages about cars Integer and string variables and HWND (window handle) variable, constants, repeat loop, nested case statements, Readln, ShellExecute   Information
Functions Heemesh Vara Demonstration of inbuilt Pascal functions Integer, string, char and byte variables, procedures, repeat loop, case statement, DateToStr, Ord, Chr, ReverseString, SetConsoleTextAttribute   Educational
Betting Alex Griffiths Horse racing with odds For loops and repeat loops, if and case statements, Boolean operators, Sleep, Random   Game
Betting Game Arnav User bets on Premiership matches with odds For loop and repeat loops, if and case statements, Sleep, Random, Append, AssignFile, CloseFile   Game
Bogosort Lewis Wright Frivolous random sort Constant, Boolean variables, for loops and repeat loops, function, array, Random   Educational
MarbleDrop Adam Renak Simulation of falling marble deflected randomly left or right by pins Procedures, arrays, repeat loop, case statements, Random, Writeln   Game
Battleships Lewis Wright Pascal version of the paper and pencil battleships game Procedures, arrays, Boolean variables, for loops and repeat loops, if and case statements, Boolean operators   Game
DelphiManager Matt Tucker Soccer simulation, giving minute-by-minute updates of the score and frequent highlights Many examples of different types of procedures, arrays, loops, and selection   Game
Arithmetic, also available as Oxygene version Peter Hearnshaw Arithmetic using Reverse Polish Notation (RPN) Implementation of a stack, arrays, Chr, Ord, StrToFloat, Inc   Educational
BattleshipGames Josh Blake Battleships with a choice of several modes Technical features Delphi 2007 Game
Calculator Christopher Winward Calculator that evaluates expressions comprising integers and/or fixed-point real numbers with the operators +, -, *, / and ^ and brackets. Object-oriented code, pointers, implementation of a stack, TLists, error messages, enumerated type, nested case statements, nested routines, helpful comments, C-type operators, the ** operator for exponentiation (in the Math unit), Inc, Exit   Educational
CollatzASM Felix Thompson In-line assembler code for calculating Collatz chain lengths ADD, MOV, CMP, JE, JMP   Educational
Encrypt Peter Hearnshaw In-line assembler code for encrypting a number LEA, ADD, SUB, DEC, MOV, CMP, JG, PUSH, POP   Educational
Mazer Ihsan Fazal Maze game Procedures, reading file of records into array, Windows.Beep (for music), Random data-mazer01-local.txt Game
Crossword, also available as Oxygene version Adam Renak Matches target partial words with wildcards to words in dictionary String arrays, reading of text file, procedures, Length, Inc, LowerCase DictWordlist.txt Educational
Compressor & Decompressor Adam Greenberg Compression and decompression of text files For loops and while loops, arrays, file handling, string manipulation, thorough commenting, FileSize reactions.txt Educational
Shoot Nathan User "shoots" at moving target Timers, Images, Random, ShowMessage, Close Frame-based Game
           
Tester & TestMaker James Tester inputs the tests you make with TestMaker to test the user File handling, arrays, ClrScr, assignFile, reset, rewrite, closeFile Crt Educational
TankGame James Two tanks fight to the death or to a stalemate Dynamic arrays, Uppercase, Inc, SetLength, ClrScr, CursorOff, GoToXY, WindMaxY, KeyPressed, ReadKey, WhereX Crt Game
SnakeWithoutATail Joe Snake that eats fruit Case statement, CursorOff, GoToXY, Random, ReadKey and in Versions 2 and 3 objects and PlaySound Crt Game
Trapped Reggie Interactive story procedure, TextBackground, Inc, Dec, Halt, TextColor, ClrScr, CursorOff, KeyPressed, ReadKey, GoToXY Crt Game
SpaceEvaders Neil Game in which you try to avoid vertically and horizontally moving enemies If and case statements, TextBackground, TextColor, CursorOff, GoToXY, Random, ReadKey, Halt Crt Game
GoalQuest Nikhil Game in which you try to avoid moving enemies while heading for the goal If and case statements, objects, TextBackGround, TextColor, CursorOff, GoToXY, Random, Inc, DecReadKey, Halt, Sleep Crt Game
MazePlus Nikhil Game in which you try to navigate the maze quickly and land on top of the target TextBackGround, TextColor, WhereX, WhereYGoToXY, Ord, Time, AssignFileReset, CloseFile, Sleep Crt, MazePlus.lpr Game
Chainer Nikhil Runs three games in succession TProcess with options and the CommandLine and Execute routines, TextBackGround, TextColor Crt, MazePlus.exeGoalQuest.exe, Roller.exe Educational
MarbleRun Christopher Winward Simulation of falling marble deflected randomly left or right by pins Case statements, CursorOff, GoToXY, Random, ReadKey, Val Crt Game
Trains Peter Hearnshaw Active timetable for London to Liverpool trains Arrays, string manipulation, DIV, MOD, Now Crt Information
Physics Charles Tanner Physics calculations Enumerated types, set constants, case statements, ReadKey, LeftStr, Length, FloatToStr, StrToFloat Crt Educational
MorseCode Jack Fearn Translates to and from Morse code Arrays, Ord, Chr, Windows.Beep, ClrScr, ShellExecute Crt Educational
Hangman Alex Karet Hangman with scoring and choice of word lists Several units, For-In loops, file handling, ClrScr, Inc, Dec, Length, SetLength, Eof, Assign Crt, WordListEasy.txt, WordListMedium.txt, wordlist.txt Game
Snake Peter Hearnshaw Snake that grows when it eats Arrays, case statements, GoToXY Crt Game
StopwatchLaz Daniel Lever Times up to eight swimmers completing up to four lengths with one of four different strokes Procedures, arrays, Time, GoToXY, ClrEol, Trunc Crt Information
ascii3D Peter Hearnshaw Retro car racing game Procedures, arrays, repeat loop, Random, StringReplace, Delete, Writeln, ClrEol, ClrScr Crt Game
Risk Michael Wardley Console program based on the Risk board game Procedures, validation, array of records, repeat and for loops, if and case statements, Random, Readln, Writeln, Sleep, ClrScr Crt Game
CrazyMaze James Hall Maze game Maps constructed in spreadsheet, arrays (including 3D), procedures, GoToXY, ReadKey, TextColor, TextBackground Crt Game
PascalPokemon Max Foster Pokemon clone Arrays, deeply nested selection and iteration constructs, file handling, string manipulation, records, classes and objects, c syntax, procedures with up to eight parameters, icon Crt, map1.txt, map2.txt, map3.txt, PascalPokemon.ico Game
           
MultiDraw, also available as applet Ihsan Fazal Draws parallel lines of different colours InitGraph, WriteBuf, ReadBuf, PutPixel, GetMouseX, GetMouseY, CloseGraphRequest WinCrt.pas, WinGraph.pas, WinMouse.pas Visual effect
Roller, also available as applet and as JavaScript web version Neil User makes the sphere jump to avoid horizontally moving barb InitGraph, closeGraph, , Inc, RandomRange, Randomize, Delay, SetWindowSize, SetColor, SetFillStyle, FillEllipse, Bar, SetTextStyle, OutTextXY, ReadKey, CloseGraphRequest and in Version 2, AssignFile, CloseFile, Reset, Rewrite WinCrt.pas, WinGraph.pas, WinMouse.pas Game
PixelSort, also available as web version James Hall Motion graphics Arrays, Sin, Cos, ArcTan, UpdateGraph, GetMouseX, GetMouseY, Random, SetColor, Line WinCrt.pas, WinGraph.pas, WinMouse.pas Visual effect
WaveInterference James Gunn Draws sine waves and sums them Conditional compilation, dynamic arrays, SetLength, Sin, Random, SetColor, MoveTo, LineTo, Val WinCrt.pas, WinGraph.pas Educational
Notes James User selects font/size and points to next text position Technical features WinCrt.pas, WinGraph.pas, WinMouse.pas Office Application
SuperHappyFunLand, also available as web version James Hall Draws from different positions of the observer 3D objects constructed from polygons Multi-dimensional arrays, Sin, Cos, ArcTan, InitGraph, UpdateGraph, SetWindowSize, SetFillStyle, FillRect, FillPoly, DrawPoly WinCrt.pas, WinGraph.pas Visual effect
FlyingUK, also available as web version Peter Hearnshaw User navigates flight over part of the UK InitGraph, PutPixel, SetTextStyle, SetFillStyle, OutTextXY, LineTo Crt, WinCrt.pas, WinGraph.pas, WinMouse.pas, places.txt Educational
3D-Driving, also available as web version Peter Hearnshaw User drives round a circuit marked by hexagonal prisms Round, GetMaxX, GetMaxY, GetMouseX, Sin, Cos, ArcTan WinCrt.pas, WinGraph.pas, WinMouse.pas Game
MolyMaker Peter Hearnshaw Predicts infrared spectra of molecules constructed by the user Round, Sin, InitGraph, UpdateGraph, GetMaxX, GetMaxY, SetLineStyle, SetTextStyle, Line, LineTo, GetMouseEvent, PollMouseEvent WinCrt.pas, WinGraph.pas, WinMouse.pas Educational
CrazyPaint (includes saveall and loadall) James Hall Paint program that you can use to draw lines, fill outlines with colour, erase areas and load and save bitmap files SetFillStyle, InitGraph, UpdateGraph, SetWindowSize, FloodFill, SetColor, SetBkColor, BlockRead, GetMem, FreeMem, Exec WinCrt.pas, WinGraph.pas, WinMouse.pas, saveall.exe, loadall.exe, folders: Icons and savedata Visual effect
GameOfLife (includes saveall, loadall and savepatt) James Hall Version of Conway's Game of Life showing patterns of cells surviving according to simple rules AssignFile, Reset, Rewrite, InitGraph, UpdateGraph, SetWindowSize, SetFillStyle, Rectangle, SetColor, PutImage, BlockRead, GetMem, FreeMem, Exec, GetMouseX, GetMouseY, GetMouseWheel, GetMouseButtons, OutTextXY WinCrt.pas, WinGraph.pas, WinMouse.pas, saveall.exe, loadall.exe, savepatt.exe, folders: Icons and savedata Educational
Adventures Peter Hearnshaw Platform game with jumping goat AssignFile, PutPixel, Bar, FillPoly, SetFillPattern WinCrt.pas, WinGraph.pas, WinMouse.pas, donkey_left.txt, donkey_right.txt, spring.txt, carrot.txt Game
Knowledge, also available as web version Peter Hearnshaw Taxi navigation in the West End Random, UpdateGraph, GetMem, BlockRead, PutImage, FreeMem, GetMouseX, ReadKey, GetPixel, PollMouseEvent, GetMouseEvent WinCrt.pas, WinGraph.pas, WinMouse.pas, folder of bitmaps: maps Educational
FaceChange Peter Hearnshaw Changes the shape of a face in a photograph Arrays, GetMem, BlockRead, SetWindowSize, OutTextXY, ClearDevice, PutPixel WinCrt.pas, WinGraph.pas, WinMouse.pas, image.bmp Visual effect
GASP Peter Hearnshaw Simulates the flow of instructions and data through registers as your assembler program is executed TProcess for executing another application, many routines including Round, Sin, InitGraph, UpdateGraph, GetMaxX, GetMaxY, SetLineStyle, Line, LineTo, SetFillStyle, SetTextStyle, outTextXY, GetMouseEvent, PollMouseEvent, Pos, Delete WinCrt.pas, WinGraph.pas, WinMouse.pas Educational
           
My_first_sdl, also available as web version Steven Binns Motion graphic using SDL and SDL_gfx C-type syntax, SDL_Init, SDL_SetVideoMode, EllipseColor, SDL_Flip, SDL_Delay, SDL_FreeSurface, SDL_Quit SDL.pas, jedi-sdl.inc, SDL_gfx.pas, SDL.dll, SDL_gfx.dll Visual effect
My_first_sdl2 Steven Binns Motion graphic using SDL2 Very thoroughly commented, C-type syntax, SDL_Init, SDL_CreateWindow, SDL_CreateRenderer, SDL_SetRenderDrawColor, SDL_RenderClear, SDL_RenderPresent, SDL_Delay, SDL_DestroyWindow, SDL_DestroyRenderer,SDL_Quit See downloadable zip file Visual effect
Invader, also available as web version Steven Binns Game of a bug's survival against white blood cells Control by mouse, music, alpha blending, SDL_Init, SDL_SetVideoMode, SDL_BlitSurface, SDL_Flip, SDL_Delay, SDL_FreeSurface, SDL_Quit, FilledCircleColor SDL.dll, SDL_gfx.dll, SDL_mixer.dll, SDL_ttf.dll, libfreetype-6.dll, zlib1.dll, John Stump - Death Waltz.mid Game
Blink Steven Binns Game with teleporting hats See the impressive technical features See the zip download Game
A_star, also available as web version Christopher Winward Demonstration of the A* algorithm for finding the shortest path through a network of nodes Object-oriented code, linked lists, conditional compilation, nested routines, sqrt, exit, SDL_Init, SDL_SetVideoMode, SDL_WM_SetCaption, SDL_GetVideoSurface, SDL_FillRect, SDL_PollEvent, SDL_GetMouseState, SDL_GetTicks, SDL_MapRGB SDL.pas, jedi-sdl.inc, SDL_gfx.pas, SDL.dll, SDL_gfx.dll Educational
CowGame Peter Hearnshaw Platform game with jumping cow, elephants and blimp SDL_FillRect, SDL_GetKeyState, SDL_MouseButtonDown, SDL_BlitSurface, SDL_SetColorKey, FilledPolygonColor, SDL_MapRGB, SDL_DisplayFormat, RotozoomSurface, SDL_PumpEvents SDL.pas, jedi-sdl.inc, SDL_gfx.pas, SDL_image.pas, SDL.dll, SDL_gfx.dll SDL_image.dll Game
NetworkChat Max Foster Enables several users on networked computers to chat. Contains the SuperMaximo SDL AppEngine to facilitate programming with SDL_NET. Pointers, buffers, default parameters, GotoXY, TextColor, SDL_PollEvent, SDLNet_CheckSockets, SDLNet_SocketReady, SDLNet_TCP_Send, SDLNet_TCP_Recv, SDLNet_AllocPacket Crt, SDL.pas, jedi-sdl.inc, SDL_NET.pas, SDL.dll, SDL_Net.dll Communication
AlphaServer and AlphaClient James Hall Enables users on networked computers to chat and move their named sprite SDL_Init, SDLNet_Init, SDLNet_ResolveHost, SDLNet_CheckSockets, SDLNet_AllocSocketSet, SDLNet_FreeSocketSet, SDLNet_TCP_AddSocket, SDLNet_TCP_DelSocket, SDLNet_TCP_Accept, SDLNet_TCP_Open, SDLNet_TCP_Recv, SDLNet_TCP_Send, SDLNet_TCP_Close, SDLNet_SocketReady, TTF_OpenFont, TTF_RenderText_Solid SDL.pas, jedi-sdl.inc, SDL_mixer.pas, sdl_ttf.pas, SDL.dll, SDL_mixer.dll, SDL_ttf.dll, libfreetype-6.dll, smpeg.dll, zlib1.dll, arial.ttf, folders: images, sounds Communication
SaveUK Peter Hearnshaw Plane flies over map of UK and shoots down aliens Round, SDL_Init, SDL_SetVideoMode, SDL_LoadBMP, SDL_FillRect, SDL_BlitSurface, SDL_SetColorKey, SDL_MapRGB, TTF_OpenFont, TTF_RenderText_Solid, SDL_DisplayFormat, RotozoomSurfaceSizeXY, SDL_PollEvent, SDL_GetKeyState, SDL_PumpEvents, SDL_Flip, SDL_Delay, SDL_Quit SDL.pas, jedi-sdl.inc, sdlutils.pas, SDL_gfx.pas, SDL_image.pas, sdl_ttf.pas, SDL.dll, SDL_gfx.dll SDL_image.dll, sdl_ttf.dll, zlib1.dll, 13 bitmap images, libfreetype-6.dll folder : images Educational Game
KoalasInSpace James Hall Koala moves and fires bullets at enemies that home in on it Trig functions, sound mixing, input from keyboard and mouse button using SDL, SDL_BlitSurface, SDL_Freesurface, SDL_MapRGB, SDL_SetColorKey, , SDL_Flip, SDL_Delay, SDL_LoadBMP, TTF_OpenFont, TTF_CloseFont, MIX_LoadMus, MIX_LoadWav, MIX_VolumeChunk, MIX_PlayMusic, MIX_PlayChannel, MIX_HaltMusic, MIX_HaltChannel, Dispose SDL.pas, jedi-sdl.inc, SDL_mixer.pas, sdl_ttf.pas, SDL.dll, SDL_mixer.dll, SDL_ttf.dll, libfreetype-6.dll, smpeg.dll, zlib1.dll, arial.ttf, images (folder), sounds (folder) Game
SpaceShooter Christopher Winward Space shooter fires with guns and lasers at advancing rocks Object-oriented code, pointers, bit masks, trig functions, sound mixing, input from keyboard and mouse button using SDL, timers, direct access to data, and subroutines with variable and default parameters, C-type syntax, SDL_gl_SwapBuffers, glLoadIdentity, glPushMatrix, glDisable, glTranslatef, gl_Blend, glBindTexture, glBegin, gl_Quads, gl_Texture_2D, glColor3f, glVertex3f SDL.pas, jedi-sdl.inc, SDL_image.pas, SDL_mixer.pas, SDL_gfx.pas, GL.pas, GLU.pas, SDL.dll, SDL_gfx.dll, SDL_mixer.dll, SDL_ttf.dll, SDL_image.dll, libpng12-0.dll, zlib1.dll, folders: images, sounds Game
TesterGameEngine (includes DatabaseEditor) Steven Binns Game engine combined with code to test pupils Object-oriented code, text and 3D graphics using OpenGL, use of camera for panning, input from keyboard and mouse button using SDL, C-type syntax, many routines used including SDL_SetVideoMode, SDL_gl_SwapBuffers, SDL_PollEvent, glLoadIdentity, glPushMatrix, glEnable, glDisable, glBegin, gl_Quads, glClear, glClearColor, glColor3f, glVertex3f, glViewport, glMatrixMode SDL.pas, jedi-sdl.inc, SDL_gfx.pas, GL.pas, GLU.pas, SDL.dll, SDL_gfx.dll, SDL_ttf.dll Game Engine
ALifeSim Steven Binns Artificial life simulator Object-oriented code, graphics using SDL/OpenGL, ini files, FileExists, ShellExecute SetLength, SDL_SetVideoMode, SDL_Init, SDL_FillRect, FilledCircleColor SDL.pas, jedi-sdl.inc, SDL_gfx.pas, SDL.dll, SDL_gfx.dll Educational
Word_processor Jerzy Griffiths Word processor for authors See Use of Inbuilt Components and Routines Frame-based Delphi XE4 Office Application
MrSnugglekins and the Giant Sack of Catnip (includes earlier Pascal version of the SuperMaximo GameLibrary) Max Foster Cat tries to defend catnip against army of Spambots Object-oriented code, virtual and abstract methods, pointers, 3D graphics using OpenGL trig functions, sound mixing, input from keyboard (and mouse and joystick/gamepad optionally) using SDL, timing, subroutines with variable and default parameters, C-type syntax, enumerated types, sets, MkDir, DirectoryExists, SDL_gl_SwapBuffers, SDL_SetAlpha, SDL_CreateRGBSurface, glDisable, glTexParameteri, gl_Blend, glBindTexture, glTexImage2D, glGenVertexArrays, gl_Texture_2D, glBindVertexArray, glDeleteTextures At least OpenGL 2.1 with GLSL version 1.1, SDL.pas, jedi-sdl.inc, SDL_image.pas, SDL_mixer.pas, SDL_gfx.pas, dglOpenGL.pas, SDL.dll, SDL_gfx.dll, libpng12-0.dll, SDL_mixer.dll, SDL_ttf.dll, SDL_image.dll, libfreetype-6.dll, folder: assets Game
           
PenApplet Joel Applet that enables you to draw with a pen. AddMouseListener, AddMouseMotionListener, GetSize, SetBackground, DrawLine SetColor, FillRect Oxygene for Java Visual effect
RollerApplet Neil Applet version of Roller AddMouseListener, SetBackground, FillRect, FillOval, DrawString Oxygene for Java Game
RandomNumberGenerator (Java program also available in Oxygene for Java) Luke Outputs random numbers in the quantities and range selected by the user Object-oriented code, extensive validation, GUI constructed in code Oxygene for Java Educational
OnScreenTimer (Java program also available in Oxygene for Java) Luke Outputs elapsed time Object-oriented code, GUI constructed in code, mouse input Oxygene for Java Educational
           
ObjectMovingBalls George Draws coloured circles moving at different speeds around a square Array of objects, c-style operators, Ellipse, FillRectF, BeginPath, Fill, ClosePath Smart Mobile Studio Visual effect
BlendingEllipses Alex Karet Draws randomly positioned, sized and coloured ellipses with alpha blending Ellipse, FillRectF, BeginPath, Fill, ClosePath Smart Mobile Studio Visual effect
MaxCircles Felix Thompson Draws coloured circles that fit exactly into available space RandomInt, Abs, Round, Sqrt, Sqr Smart Mobile Studio Visual effect
BallTrajectory Felix Thompson Ball moves under the effects of gravity, friction and restitution Ellipse, FillRectF, BeginPath, Fill, ClosePath Smart Mobile Studio Educational
PlatformDemo Steven Binns User presses keys to control players' jumps between platforms Object-oriented code, keyboard input, Round, FillRect, Ellipse Smart Mobile Studio Educational
SpaceInvaders Josh Blake User avoids invaders and shoots them Technical features Smart Mobile Studio Game
RoamingBlockBuster Joel User busts the randomly moving blocks by firing at them Object-oriented code, keyboard input, RandomInt, FillRect, FillRectF Smart Mobile Studio Game
RandomPlatformScroller George User jumps and falls to reach door to next level Technical features Smart Mobile Studio Game
Programming - a skill for life!

Student programs to inspire you!