Control Structures
Aside from its unique answer judging mechanisms, TUTOR's original set of control structures was rather sparse. In the mid 1970's, this shortcoming was addressed by introducing if, endif blocks with optional elseif and else sections. The semantics of these control structures was routine, but the syntax was unique, with mandatory indentation presaging that of Python and a unique use of nonblank indent characters to distinguish indenting from continuation lines.
This is illustrated in the following example, from page S5 of the Summary of TUTOR Commands and System Variables (10th ed) by Elaine Avner, 1981:
if n8<4 . write first branch . calc n9⇐34 elseif n8=4 . write second branch . do someunit else . write default branch . if n8>6 . . write special branch . endif endif(The assignment arrow in the calc statement is not rendered correctly in some browsers. It appears similar to <= but as one character. It had a dedicated key on the PLATO IV keyboard.)
The same syntax was used for loop, endloop blocks with semantics comparable to while loops in conventional programming languages. This is illustrated in the following example, from page S6 of the Summary of TUTOR Commands and System Variables (10th ed) by Elaine Avner, 1981:
loop n8<10 . write within loop . sub1 n8 reloop n8≥5 . write still within loop . do someunit outloop n8<3 . write still within loop endloop write outside of loopNote that the reloop and outloop commands are somewhat analogous to the continue and break statements of languages based on C, except that they must sit at the indenting level of the loop they modify, and they have a condition tag that indicates when the indicated control transfer is to take place.
Read more about this topic: TUTOR (programming Language), Unique Features
Famous quotes containing the words control and/or structures:
“The inability to control our childrens behavior feels the same as not being able to control it in ourselves. And the fact is that primitive behavior in children does unleash primitive behavior in mothers. Thats what frightens mothers most. For young children, even when out of control, do not have the power to destroy their mothers, but mothers who are out of control feel that they may destroy their children.”
—Elaine Heffner (20th century)
“The philosopher believes that the value of his philosophy lies in its totality, in its structure: posterity discovers it in the stones with which he built and with which other structures are subsequently built that are frequently betterand so, in the fact that that structure can be demolished and yet still possess value as material.”
—Friedrich Nietzsche (18441900)