Learning Modula2 through exercises


During the exercises that you find on this page we, or more exactly YOU, will learn to program using the programming language Modula2. It is a relatively simple yet sufficiently powerful language which is perfectly suited for education.

Learning to program in Modula2 is like learning to speak a new language. You will have to memorize a whole set of new words. Learn to understand what they mean so that you can use them at the right moment. Not forgetting that you have to be able to write them correctly (computers are very bad at understanding what you actually mean!).

But this is not enough! Programming is about using one such language to control a computer to solve your problems. Programming is to computer language what literature is to a language: the realisation of ones idea using the given tool (be it a computer or human language).


How can you learn to use Modula2 to solve your problems? We always start with simple  programs which demonstrate well defined constructions, concepts, functionalities or features available in Modula2.

Each program serves as a basis for an exercise which requires your brain power. Yes, you will need to get your hands dirty to learn to program in Modula2. In other words, you will be reading, executing and modifiying programs all the time. And before you know it the brand new (programming) language will turn out to be quite readable actually. If and only if you put all your energy into making the exercises! Experience learn that reading the exercises is not enough!


The software (XDS compiler) we use can be found here You DO NEED to install the TopSpeed package after installing the XDS compiler! So download both.

If you have problems with XDS we have a troubleshooting page here.


More general Modula-2 related information can be found here and here An introduction written 3 year ago, still good ;)

Getting started on the building K computers

Here you find an illustrated guide to help you get started with the XDS compiler. It is made specially for the configuration of the computers at the 3rd floor of building K. So if you try this from home the location of the programs will be different. The introduction page can be found by clicking on this line.

Solutions page

The solution to the exercises are here.

Table of content

Lesson 1 Lesson 2 Lesson 3 Lesson 4 Lesson 5 Lesson 6 Lesson 7 Lesson 8 Lesson 9 Lesson 10 Lesson 11 Lesson 12 Lesson 13 Lesson 14 Lesson 15 Lesson 16 Lesson 17