Post Reply 
ppl plots multi-coloured point within a quarter circle
06-24-2021, 04:40 AM
Post: #1
ppl plots multi-coloured point within a quarter circle
This program demonstrates plotting different coloured point within a quarter circle.

It clears the screen, sets up local variables, uses a for loop, used the RANDINT
function to generate numbers for colours and points. It then plots the points
using the PIXon_P command for each cycle of the for loop.
The FREEZE commpands pauses the screen. Press Esc to exit the programs.

I thought some new users could benefit from seeing this program.

Code:

// qtrcrc02 plots a quarter circle
// with different coloured points
EXPORT qtrcrc02()
BEGIN
print; // clear the text screen
rect(); // clear the graphics screen
local i,m;
local x,y,z;
local a,b,c;
m := 65000;
z := 208*208;
for i from 1 to m
do
x := randint(0,208);
y := randint(0,208);
a := randint(0,255);
b := randint(0,255);
c := randint(0,255);
if x*x+y*y <= z then pixon_p(x,y,rgb(a,b,c))
end;

END;
freeze;
end;

Thanks.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
ppl plots multi-coloured point within a quarter circle - Liamtoh Resu - 06-24-2021 04:40 AM



User(s) browsing this thread: 1 Guest(s)