var wino := Window.Open ("graphics:480;480,noecho, nocursor")
Window.Set (wino, "title: " + "Atom and Ray")
var ballx, bally : array 1 .. 5 of int
for i : 1 .. 11 %Draws the grid
drawline (60 + i * 30, 90, 60 + i * 30, 390, 17)
drawline (90, 60 + i * 30, 390, 60 + i * 30, 17)
drawline (60 + 30 * i, 30, 60 + 30 * i, 60, black)
drawline (60 + 30 * i, 420, 60 + 30 * i, 450, black)
drawline (30, 60 + 30 * i, 60, 60 + 30 * i, black)
drawline (420, 60 + 30 * i, 450, 60 + 30 * i, black)
end for
for i : 1 .. 5
%Randomly selects 5 x and 5 y cordinates and draws 5 circles
ballx (i) := 90 + (Rand.Int (2, 9) * 30) - 15
bally (i) := 90 + (Rand.Int (2, 9) * 30) - 15
drawfilloval (ballx (i), bally (i), 13, 13, 7)
end for |