next up previous
Next: 2 Function Values Up: APS105F Friday Quiz 1 Previous: Instructions

1 Drawing Dots

Write a program that starts by requesting an integer in the range 0 < N < 20. Numbers outside this range are rejected and a new request is made. Print a triangle of dots (periods) with dimensions as shown in the example below. The dots are separated by spaces in the horizontal dimension and there are no blank lines between the rows. The program then exits.

With N = 5, the output will be

.
. .
. . .
. . . .
. . . . .

Restrictions:

You may not use a for statement for this program, even though it probably makes more sense to do so. Also, do not use locate to position the output.

Hint:

You can use the Turing command ``put x..'' (as opposed to ``put x'') to prevent the cursor from going on to the next line after the value of x is output.

A solution



Paul Chow
Sun Oct 27 10:55:46 EST 1996