Computer Studies‎ > ‎Turing‎ > ‎Turing Tutorial‎ > ‎

Turing 014 — Field Widths

A colon can be used to tell Turing how much space you want something to take on the screen. This is useful when you are printing columns of data or information, such as on a sales receipt. Example:

put "Item" : 12, "Qu." : 12, "Cost" : 12, "Total" : 12
put "Apples" : 10, 3 : 4, 0.75 : 14, 3 * 0.75 : 13

...prints the following:


Assignment

Create a neatly-spaced "times table" from 12 x 1 to 12 x 12 that uses field widths.



Save as "014.t".
Comments