TILTraining Set

Software Transformation Systems
Tiny Imperative Language (TIL) Example Programs

Only a couple so far, hopefully many more to come. Possibly we should add a commenting convention to the TIL language to make these more readable.


var n;
write "Input n please";
read n;
write "The factors of n are";
var f;
f := 2;
while n != 1 do
    while (n / f) * f = n do
        write f;
        n := n / f;
    f := f + 1;

-- JamesCordy - 22 Aug 2005