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.

factors.til

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;
    end
    f := f + 1;
end

-- JamesCordy - 22 Aug 2005

Revision: r1.1 - 22 Aug 2005 - 04:32 - JamesCordy
Sts > StsBench > TILChairmarks > TILTrainingSet
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback