4.
3.
2.
•
Write
a program
to
draw straight lines
all
over the screen.
The
lines should be
of
random length and direction.
Each
should
start
where the previous one finished
and each should
have
a randomly chosen
colour.
Write
a program
to
draw lines randomly
with
the restriction
that
each line has a
random
start
on
the lett hand edge
of
the screen.
Write
a program
to
draw lines randomly
with
the restriction that the lines start
at
the same point
on
the bottom edge
of
the
screen
Write
a program
to
produce
Imes
of
random length, starting points and colour.
All
lines must
be
horizontal.
5.
As
problem 4 but make the lines vertical.
PROBLEMS
ON
1.
CHAPTER
3
6.
Write
a program
to
produce a square 'spiral'
In
such a
way
that each line makes
a random colour
HINT
First
find the co-ordinates
of
some
of
the corners, then put them
In
groups
of
four.
You
should discover a pattern.
•
•
•
18
12/84