DECLARE SUB ruut2 (x!, y!, z!, s!)\r
-DECLARE SUB ruut (x!, y!, z!, s!)\r
-DECLARE SUB kuus (x, y, z, s)\r
+DECLARE SUB ruut (x%, y%, z%, s%)\r
+DECLARE SUB kuus (x!, y!, z!, s!)\r
DECLARE SUB porand ()\r
-DECLARE SUB addp (x, y, z)\r
-' kursor keys and to z, w - rotate\r
+' Cursor keys and to z, w - rotate\r
' <SPACE> - speed down\r
' q - quit\r
\r
myy = 0\r
myz = -1000\r
\r
-\r
-\r
start\r
\r
nait3d\r
\r
-SUB addp (x, y, z)\r
-c = 1\r
+SUB addp (x%, y%, z%)\r
+ c = 1\r
\r
-xn(nump + 1) = -100 + x\r
-yn(nump + 1) = y\r
-zn(nump + 1) = -100 + z\r
+ ' Define the vertices of a square in 3D space\r
+ xn(nump + 1) = -100 + x\r
+ yn(nump + 1) = y\r
+ zn(nump + 1) = -100 + z\r
\r
-xn(nump + 2) = 100 + x\r
-yn(nump + 2) = y\r
-zn(nump + 2) = -100 + z\r
+ xn(nump + 2) = 100 + x\r
+ yn(nump + 2) = y\r
+ zn(nump + 2) = -100 + z\r
\r
-xn(nump + 3) = 100 + x\r
-yn(nump + 3) = y\r
-zn(nump + 3) = 100 + z\r
+ xn(nump + 3) = 100 + x\r
+ yn(nump + 3) = y\r
+ zn(nump + 3) = 100 + z\r
\r
-xn(nump + 4) = -100 + x\r
-yn(nump + 4) = y\r
-zn(nump + 4) = 100 + z\r
+ xn(nump + 4) = -100 + x\r
+ yn(nump + 4) = y\r
+ zn(nump + 4) = 100 + z\r
\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
-col(numl + 1) = c\r
+ ' Define the edges of the square\r
+ point1(numl + 1) = nump + 1\r
+ point2(numl + 1) = nump + 2\r
+ col(numl + 1) = c\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
-col(numl + 2) = c\r
+ point1(numl + 2) = nump + 2\r
+ point2(numl + 2) = nump + 3\r
+ col(numl + 2) = c\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
-col(numl + 3) = c\r
+ point1(numl + 3) = nump + 3\r
+ point2(numl + 3) = nump + 4\r
+ col(numl + 3) = c\r
\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 1\r
-col(numl + 4) = c\r
+ point1(numl + 4) = nump + 4\r
+ point2(numl + 4) = nump + 1\r
+ col(numl + 4) = c\r
\r
-nump = nump + 4\r
-numl = numl + 4\r
+ ' Update the counters for the next square\r
+ nump = nump + 4\r
+ numl = numl + 4\r
\r
END SUB\r
\r
SUB getcor\r
\r
-xn(nump + 1) = -150\r
-yn(nump + 1) = -125\r
-zn(nump + 1) = -200\r
+ ' Define the vertices of a square in 3D space\r
+ xn(nump + 1) = -150\r
+ yn(nump + 1) = -125\r
+ zn(nump + 1) = -200\r
\r
-xn(nump + 2) = 150\r
-yn(nump + 2) = -125\r
-zn(nump + 2) = -200\r
+ xn(nump + 2) = 150\r
+ yn(nump + 2) = -125\r
+ zn(nump + 2) = -200\r
\r
-xn(nump + 3) = 150\r
-yn(nump + 3) = 125\r
-zn(nump + 3) = -200\r
+ xn(nump + 3) = 150\r
+ yn(nump + 3) = 125\r
+ zn(nump + 3) = -200\r
\r
-xn(nump + 4) = -150\r
-yn(nump + 4) = 125\r
-zn(nump + 4) = -200\r
+ xn(nump + 4) = -150\r
+ yn(nump + 4) = 125\r
+ zn(nump + 4) = -200\r
\r
+ ' Define the edges of the square\r
+ point1(numl + 1) = nump + 1\r
+ point2(numl + 1) = nump + 2\r
\r
-xn(nump + 5) = -150\r
-yn(nump + 5) = -125\r
-zn(nump + 5) = 200\r
+ point1(numl + 2) = nump + 2\r
+ point2(numl + 2) = nump + 3\r
\r
-xn(nump + 6) = 150\r
-yn(nump + 6) = -125\r
-zn(nump + 6) = 200\r
+ point1(numl + 3) = nump + 3\r
+ point2(numl + 3) = nump + 4\r
\r
-xn(nump + 7) = 150\r
-yn(nump + 7) = 125\r
-zn(nump + 7) = 200\r
+ point1(numl + 4) = nump + 4\r
+ point2(numl + 4) = nump + 1\r
\r
-xn(nump + 8) = -150\r
-yn(nump + 8) = 125\r
-zn(nump + 8) = 200\r
+ ' Define the vertices of another square in 3D space\r
+ xn(nump + 5) = -150\r
+ yn(nump + 5) = -125\r
+ zn(nump + 5) = 200\r
\r
+ xn(nump + 6) = 150\r
+ yn(nump + 6) = -125\r
+ zn(nump + 6) = 200\r
\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
+ xn(nump + 7) = 150\r
+ yn(nump + 7) = 125\r
+ zn(nump + 7) = 200\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
+ xn(nump + 8) = -150\r
+ yn(nump + 8) = 125\r
+ zn(nump + 8) = 200\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
+ ' Define the edges of the second square\r
+ point1(numl + 5) = nump + 5\r
+ point2(numl + 5) = nump + 6\r
\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 1\r
+ point1(numl + 6) = nump + 6\r
+ point2(numl + 6) = nump + 7\r
\r
-point1(numl + 5) = nump + 5\r
-point2(numl + 5) = nump + 6\r
+ point1(numl + 7) = nump + 7\r
+ point2(numl + 7) = nump + 8\r
\r
-point1(numl + 6) = nump + 6\r
-point2(numl + 6) = nump + 7\r
-\r
-point1(numl + 7) = nump + 7\r
-point2(numl + 7) = nump + 8\r
+ point1(numl + 8) = nump + 8\r
+ point2(numl + 8) = nump + 5\r
\r
-point1(numl + 8) = nump + 8\r
-point2(numl + 8) = nump + 5\r
+ ' Define the edges connecting the two squares into cube\r
+ point1(numl + 9) = nump + 5\r
+ point2(numl + 9) = nump + 1\r
\r
-point1(numl + 9) = nump + 5\r
-point2(numl + 9) = nump + 1\r
+ point1(numl + 10) = nump + 6\r
+ point2(numl + 10) = nump + 2\r
\r
-point1(numl + 10) = nump + 6\r
-point2(numl + 10) = nump + 2\r
+ point1(numl + 11) = nump + 7\r
+ point2(numl + 11) = nump + 3\r
\r
-point1(numl + 11) = nump + 7\r
-point2(numl + 11) = nump + 3\r
+ point1(numl + 12) = nump + 8\r
+ point2(numl + 12) = nump + 4\r
\r
-point1(numl + 12) = nump + 8\r
-point2(numl + 12) = nump + 4\r
+ ' Update the counters for the next set of vertices and edges\r
+ nump = nump + 8\r
+ numl = numl + 12\r
\r
-nump = nump + 8\r
-numl = numl + 12\r
+ ' Define a pyramid in 3D space\r
+ xn(nump + 1) = -150\r
+ yn(nump + 1) = -125 + 201\r
+ zn(nump + 1) = 0\r
\r
+ xn(nump + 2) = -150\r
+ yn(nump + 2) = -125 + 201\r
+ zn(nump + 2) = 89\r
\r
+ xn(nump + 3) = -150\r
+ yn(nump + 3) = -125\r
+ zn(nump + 3) = 89\r
\r
+ xn(nump + 4) = -150\r
+ yn(nump + 4) = -125\r
+ zn(nump + 4) = 0\r
\r
-xn(nump + 1) = -150\r
-yn(nump + 1) = -125 + 201\r
-zn(nump + 1) = 0\r
+ ' Define the edges of the pyramid\r
+ point1(numl + 1) = nump + 1\r
+ point2(numl + 1) = nump + 2\r
\r
-xn(nump + 2) = -150\r
-yn(nump + 2) = -125 + 201\r
-zn(nump + 2) = 89\r
+ point1(numl + 2) = nump + 2\r
+ point2(numl + 2) = nump + 3\r
\r
-xn(nump + 3) = -150\r
-yn(nump + 3) = -125\r
-zn(nump + 3) = 89\r
+ point1(numl + 3) = nump + 3\r
+ point2(numl + 3) = nump + 4\r
\r
-xn(nump + 4) = -150\r
-yn(nump + 4) = -125\r
-zn(nump + 4) = 0\r
+ point1(numl + 4) = nump + 4\r
+ point2(numl + 4) = nump + 1\r
\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
+ ' Update the counters for the next set of vertices and edges\r
+ nump = nump + 4\r
+ numl = numl + 4\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
-\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 1\r
-\r
-nump = nump + 4\r
-numl = numl + 4\r
-\r
-\r
-FOR x = -1000 TO 1000 STEP 250\r
-FOR z = -1000 TO 1000 STEP 250\r
-'addp x, -200, z\r
-'addp x, 200, z\r
-NEXT z\r
-NEXT x\r
porand\r
\r
END SUB\r
\r
b = 0\r
f = .3925\r
+' Calculate the vertices of a hexagon in 3D space\r
FOR a = 0 + f TO 6 + f STEP 6.28 / 8\r
-x1 = SIN(a) * s\r
-y1 = COS(a) * s\r
-b = b + 1\r
+ x1 = SIN(a) * s\r
+ y1 = COS(a) * s\r
+ b = b + 1\r
\r
-xn(nump + b) = x1 + x\r
-yn(nump + b) = y\r
-zn(nump + b) = y1 + z\r
+ xn(nump + b) = x + x1\r
+ yn(nump + b) = y\r
+ zn(nump + b) = z + y1\r
\r
NEXT a\r
\r
+' Define the edges of the hexagon\r
point1(numl + 1) = nump + 1\r
point2(numl + 1) = nump + 2\r
col(numl + 1) = 12\r
point2(numl + 5) = nump + 6\r
col(numl + 5) = 12\r
\r
-\r
point1(numl + 6) = nump + 6\r
point2(numl + 6) = nump + 7\r
col(numl + 6) = 12\r
point2(numl + 8) = nump + 1\r
col(numl + 8) = 12\r
\r
+' Update the counters for the next set of vertices and edges\r
nump = nump + b\r
numl = numl + 8\r
-'LOCATE 1, 1\r
-'PRINT b\r
-\r
-\r
-\r
\r
END SUB\r
\r
SUB nait3d\r
\r
+ ' Main loop to render the 3D scene\r
1\r
\r
-myx = myx + SIN(deg1) * mye\r
-myz = myz + COS(deg1) * mye\r
- \r
-myx = myx + COS(deg1) * myk\r
-myz = myz - SIN(deg1) * myk\r
-\r
-deg1 = deg1 + d1\r
-Deg2 = Deg2 + d2\r
- \r
-C1 = COS(deg1): S1 = SIN(deg1)\r
-C2 = COS(Deg2): S2 = SIN(Deg2)\r
- \r
-FOR a = 1 TO nump\r
-\r
-xo = xn(a) - myx\r
-yo = -yn(a) - myy\r
-zo = zn(a) - myz\r
- \r
-x1 = (xo * C1 - zo * S1)\r
-z1 = (xo * S1 + zo * C1)\r
- \r
-y1 = (yo * C2 - z1 * S2)\r
-z2 = (yo * S2 + z1 * C2)\r
- \r
-\r
-xo(a) = x(a)\r
-yo(a) = y(a)\r
-IF z2 < 20 THEN\r
-x(a) = -1\r
-ELSE\r
-x(a) = 320 + (x1 / z2 * 500)\r
-y(a) = 240 + (y1 / z2 * 500)\r
-END IF\r
-NEXT\r
- \r
-\r
-FOR a = 1 TO numl\r
-p1 = point1(a)\r
-p2 = point2(a)\r
-IF xo(p1) = -1 OR xo(p2) = -1 THEN ELSE LINE (xo(p1), yo(p1))-(xo(p2), yo(p2)), 0\r
-IF x(p1) = -1 OR x(p2) = -1 THEN ELSE LINE (x(p1), y(p1))-(x(p2), y(p2)), col(a)\r
-NEXT\r
- \r
-\r
-K$ = INKEY$\r
-IF K$ <> "" THEN\r
-\r
-SELECT CASE K$\r
-\r
-CASE CHR$(0) + "P"\r
-mye = mye - 3\r
-\r
-CASE CHR$(0) + "H"\r
-mye = mye + 3\r
-\r
-CASE CHR$(0) + "M"\r
-myk = myk + 3\r
-\r
-CASE CHR$(0) + "K"\r
-myk = myk - 3\r
-\r
-CASE "+"\r
-myy = myy + 3\r
-\r
-CASE "-"\r
-myy = myy - 3\r
-\r
-CASE "6"\r
-d1 = d1 + .01\r
-\r
-CASE "4"\r
-d1 = d1 - .01\r
-\r
-CASE "8"\r
-d2 = d2 - .01\r
-\r
-CASE "2"\r
-d2 = d2 + .01\r
-\r
-\r
-CASE " "\r
-d1 = d1 / 2\r
-d2 = d2 / 2\r
-d3 = d3 / 2\r
-mye = mye / 2\r
-myk = myk / 2\r
-\r
-CASE "q"\r
-SYSTEM\r
-\r
-CASE CHR$(27)\r
-SYSTEM\r
-END SELECT\r
-END IF\r
-\r
-GOTO 1\r
+ ' Update the position based on rotation\r
+ myx = myx + SIN(deg1) * mye\r
+ myz = myz + COS(deg1) * mye\r
+\r
+ myx = myx + COS(deg1) * myk\r
+ myz = myz - SIN(deg1) * myk\r
+\r
+ ' Update the rotation angles\r
+ deg1 = deg1 + d1\r
+ Deg2 = Deg2 + d2\r
+\r
+ ' Calculate the rotation matrices\r
+ C1 = COS(deg1): S1 = SIN(deg1)\r
+ C2 = COS(Deg2): S2 = SIN(Deg2)\r
+\r
+ ' Apply the rotation to each vertex\r
+ FOR a = 1 TO nump\r
+ xo = xn(a) - myx\r
+ yo = -yn(a) - myy\r
+ zo = zn(a) - myz\r
+\r
+ x1 = (xo * C1 - zo * S1)\r
+ z1 = (xo * S1 + zo * C1)\r
+\r
+ y1 = (yo * C2 - z1 * S2)\r
+ z2 = (yo * S2 + z1 * C2)\r
+\r
+ ' Project the vertex onto the 2D screen\r
+ xo(a) = x(a)\r
+ yo(a) = y(a)\r
+ IF z2 < 20 THEN\r
+ x(a) = -1\r
+ ELSE\r
+ x(a) = 320 + (x1 / z2 * 500)\r
+ y(a) = 240 + (y1 / z2 * 500)\r
+ END IF\r
+ NEXT\r
+\r
+ ' Draw the edges of each shape\r
+ FOR a = 1 TO numl\r
+ p1 = point1(a)\r
+ p2 = point2(a)\r
+ IF xo(p1) = -1 OR xo(p2) = -1 THEN\r
+ ' Skip drawing if the vertex is off-screen\r
+ ELSE\r
+ ' erase edge on old coordinates\r
+ LINE (xo(p1), yo(p1))-(xo(p2), yo(p2)), 0\r
+ END IF\r
+\r
+ IF x(p1) = -1 OR x(p2) = -1 THEN\r
+ ' Skip drawing if the vertex is off-screen\r
+ ELSE\r
+ ' draw edge on new coordinates\r
+ LINE (x(p1), y(p1))-(x(p2), y(p2)), col(a)\r
+ END IF\r
+ NEXT\r
+\r
+ ' Handle user input\r
+ K$ = INKEY$\r
+ IF K$ <> "" THEN\r
+\r
+ SELECT CASE K$\r
+\r
+ CASE CHR$(0) + "P"\r
+ mye = mye - 3\r
+\r
+ CASE CHR$(0) + "H"\r
+ mye = mye + 3\r
+\r
+ CASE CHR$(0) + "M"\r
+ myk = myk + 3\r
+\r
+ CASE CHR$(0) + "K"\r
+ myk = myk - 3\r
+\r
+ CASE "+"\r
+ myy = myy + 3\r
+\r
+ CASE "-"\r
+ myy = myy - 3\r
+\r
+ CASE "6"\r
+ d1 = d1 + .01\r
+\r
+ CASE "4"\r
+ d1 = d1 - .01\r
+\r
+ CASE "8"\r
+ d2 = d2 - .01\r
+\r
+ CASE "2"\r
+ d2 = d2 + .01\r
+\r
+ CASE " "\r
+ d1 = d1 / 2\r
+ d2 = d2 / 2\r
+ d3 = d3 / 2\r
+ mye = mye / 2\r
+ myk = myk / 2\r
+\r
+ CASE "q"\r
+ SYSTEM\r
+\r
+ CASE CHR$(27)\r
+ SYSTEM\r
+ END SELECT\r
+ END IF\r
+\r
+ ' Continue the main loop\r
+ GOTO 1\r
END SUB\r
\r
SUB porand\r
\r
-FOR x = -100 TO 0 STEP 12.067 + .3\r
-FOR z = -100 TO 0 STEP 12.067 + .3\r
-kuus x, -125, z, 6.53\r
-ruut x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3\r
-NEXT z\r
-NEXT x\r
+ ' Generate a grid of shapes in 3D space\r
+ FOR x = -100 TO 0 STEP 12.067 + .3\r
+ FOR z = -100 TO 0 STEP 12.067 + .3\r
+ kuus x, -125, z, 6.53\r
+ ruut x + 6.033 + .15, -125, z + 6.033 + .15, 3.111 + .3\r
+ NEXT z\r
+ NEXT x\r
+\r
+ ' Generate another grid of shapes in 3D space\r
+ FOR y = -100 TO 0 STEP 20.3\r
+ FOR x = -100 TO 0 STEP 20.3\r
+ ruut2 x, y, 200, 10\r
+ NEXT x\r
+ NEXT y\r
\r
-FOR y = -100 TO 0 STEP 20.3\r
-FOR x = -100 TO 0 STEP 20.3\r
-ruut2 x, y, 200, 10\r
-NEXT x\r
-NEXT y\r
+END SUB\r
\r
+SUB ruut (x%, y%, z%, s%)\r
\r
-END SUB\r
+ ' Define the vertices of a square in 3D space\r
+ xn(nump + 1) = x\r
+ yn(nump + 1) = y\r
+ zn(nump + 1) = z + s\r
\r
-SUB ruut (x, y, z, s)\r
-xn(nump + 1) = x\r
-yn(nump + 1) = y\r
-zn(nump + 1) = z + s\r
+ xn(nump + 2) = x + s\r
+ yn(nump + 2) = y\r
+ zn(nump + 2) = z\r
\r
-xn(nump + 2) = x + s\r
-yn(nump + 2) = y\r
-zn(nump + 2) = z\r
+ xn(nump + 3) = x\r
+ yn(nump + 3) = y\r
+ zn(nump + 3) = z - s\r
\r
-xn(nump + 3) = x\r
-yn(nump + 3) = y\r
-zn(nump + 3) = z - s\r
+ xn(nump + 4) = x - s\r
+ yn(nump + 4) = y\r
+ zn(nump + 4) = z\r
\r
-xn(nump + 4) = x - s\r
-yn(nump + 4) = y\r
-zn(nump + 4) = z\r
+ ' Define the edges of the square\r
+ point1(numl + 1) = nump + 1\r
+ point2(numl + 1) = nump + 2\r
+ col(numl + 1) = 10\r
\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
-col(numl + 1) = 10\r
+ point1(numl + 2) = nump + 2\r
+ point2(numl + 2) = nump + 3\r
+ col(numl + 2) = 10\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
-col(numl + 2) = 10\r
+ point1(numl + 3) = nump + 3\r
+ point2(numl + 3) = nump + 4\r
+ col(numl + 3) = 10\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
-col(numl + 3) = 10\r
+ point1(numl + 4) = nump + 4\r
+ point2(numl + 4) = nump + 1\r
+ col(numl + 4) = 10\r
\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 1\r
-col(numl + 4) = 10\r
+ ' Update the counters for the next square\r
+ nump = nump + 4\r
+ numl = numl + 4\r
\r
-nump = nump + 4\r
-numl = numl + 4\r
END SUB\r
\r
SUB ruut2 (x, y, z, s)\r
-xn(nump + 1) = x - s\r
-yn(nump + 1) = y - s\r
-zn(nump + 1) = z\r
\r
-xn(nump + 2) = x + s\r
-yn(nump + 2) = y - s\r
-zn(nump + 2) = z\r
+ ' Define the vertices of a square in 3D space\r
+ xn(nump + 1) = x - s\r
+ yn(nump + 1) = y - s\r
+ zn(nump + 1) = z\r
\r
-xn(nump + 3) = x + s\r
-yn(nump + 3) = y + s\r
-zn(nump + 3) = z\r
+ xn(nump + 2) = x + s\r
+ yn(nump + 2) = y - s\r
+ zn(nump + 2) = z\r
\r
-xn(nump + 4) = x - s\r
-yn(nump + 4) = y + s\r
-zn(nump + 4) = z\r
+ xn(nump + 3) = x + s\r
+ yn(nump + 3) = y + s\r
+ zn(nump + 3) = z\r
\r
-point1(numl + 1) = nump + 1\r
-point2(numl + 1) = nump + 2\r
-col(numl + 1) = 14\r
+ xn(nump + 4) = x - s\r
+ yn(nump + 4) = y + s\r
+ zn(nump + 4) = z\r
\r
-point1(numl + 2) = nump + 2\r
-point2(numl + 2) = nump + 3\r
-col(numl + 2) = 14\r
+ ' Define the edges of the square\r
+ point1(numl + 1) = nump + 1\r
+ point2(numl + 1) = nump + 2\r
+ col(numl + 1) = 14\r
\r
-point1(numl + 3) = nump + 3\r
-point2(numl + 3) = nump + 4\r
-col(numl + 3) = 14\r
+ point1(numl + 2) = nump + 2\r
+ point2(numl + 2) = nump + 3\r
+ col(numl + 2) = 14\r
\r
-point1(numl + 4) = nump + 4\r
-point2(numl + 4) = nump + 1\r
-col(numl + 4) = 14\r
+ point1(numl + 3) = nump + 3\r
+ point2(numl + 3) = nump + 4\r
+ col(numl + 3) = 14\r
+\r
+ point1(numl + 4) = nump + 4\r
+ point2(numl + 4) = nump + 1\r
+ col(numl + 4) = 14\r
\r
-nump = nump + 4\r
-numl = numl + 4\r
+ ' Update the counters for the next square\r
+ nump = nump + 4\r
+ numl = numl + 4\r
\r
END SUB\r
\r
SUB start\r
-SCREEN 12\r
-CLS\r
\r
-FOR a = 1 TO 4000\r
-col(a) = 15\r
-NEXT a\r
+ ' Initialize the screen and clear it\r
+ SCREEN 12\r
+ CLS\r
\r
-nump = 0\r
-numl = 0\r
+ ' Set the initial color of all shapes\r
+ FOR a = 1 TO 4000\r
+ col(a) = 15\r
+ NEXT a\r
\r
+ ' Initialize counters for vertices and edges\r
+ nump = 0\r
+ numl = 0\r
\r
-getcor\r
+ ' Generate the initial set of shapes\r
+ getcor\r
\r
END SUB\r
\r