Preliminaries for programming

These pages are for students in the School of Mathematics, University of Birmingham. They cover some basics about files and folders, especially on MS-Windows computers like the ones in the computer labs in the University of Birmingham, but also some general points that should be applicable to all systems. They also cover some general points relating to Lua, a very small but rather good interpreted programming language suitable for simple applications, provided performance is not of huge concern. (A nice version of LaTeX that can be scripted using Lua is also available. That is another good reason for looking at Lua. Lua is also available on some programmable calculators.)

It is expected that working through these notes will take you around 3-4 weeks.

Be very careful! One of the things you will learn is that you must type in commands exactly and even just one character wrong will often stop things working.

Objectives for this section

Contents for this section

The first four of these pages would give you a reasonable idea of what is going on and what is possible. Students will work through these at different speeds: some might be able to cover all of the topics above in three two-hour computer labs, others will take longer but it is worth going at your own speed and making sure you follow everything.

It is also well worth making notes as you go along. Even better: have a separate notebook for computer-related stuff so that it is easy to find when you need it!

If you have time left over there are links to the Lua manual for private exploration. If you don't manage everything here there will be time to catch up later if you need.

Lua is documented at https://www.lua.org/. In particular there is a useful reference manual, the first edition of which is online and covers version 5.1 of Lua. This is at https://www.lua.org/pil/contents.html. Later editions of this book have to be bought, but the first edition is sufficient here. If you have completed all the reading and work here you can follow these links for more.

Note that whatever programming you do, the exact syntax for your program will depend critically on the language you use. Basic Lua is quite straightforward to use, but a Lua program is not a C++ program or vice versa (though there are many similarities). The pages here are intended to give an idea of what can be done using a programming language and a starting point for more advanced study.

(Note that the pages listed on this page are not about programming in C++. C++ is currently covered in Birmingham Mathematics as a second year module in the spring term, and in related pages in this section of the web. If you are primarily interested in C++ you can work through these pages reasonably quickly and almost certainly they will be very useful to you, but you must remember that the syntax of Lua and C++ are slightly different in a number of respects.)

All content is copyright by Richard Kaye, http://web.mat.bham.ac.uk/R.W.Kaye/, 2018.