mgs


mgs a C code which is an example of obscure "legacy code", provided by Diane O'Leary.

Legacy code is software that is useful, but out of date, not documented, not well understood, and in need of some new features.

When approaching legacy software, it's useful to try to come up with good documentation for what the program is doing, a set of test problems which must be correctly handled by any new version of the software, and a set of timing problems that can show whether changes to the software have improved its efficiency.

In this case, the student is challenged to make a copy of the source code, read it, try to work out what it is doing, document it, and come up with a nice set of examples illustrating what is going on. A student might also be interested in the task of creating an equivalent version in a different language, and then demonstrating that the two programs produce the same results.

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

mgs is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.

Author:

Diane O'Leary.

Related Programs and Data:

mandelbrot_ascii, a C code which generates an ASCII text image of the Mandelbrot fractal set using just two lines of (very obscure) C.

mgs_test

pig_latin, a C code which converts its input to Pig Latin; this obscure program is a winner of the International Obfuscated C Code Competition in the Most Humorous category, by Don Dodson.

Reference:

  1. Dianne O'Leary,
    Computational Software: Writing Your Legacy, Partial Solution to Last Issue's Homework Assignment,
    Computing in Science and Engineering,
    Volume 8, Number 2, March/April 2006, pages 70-71.

Source Code:


Last revised on 14 July 2019.