Constrained random points on a circle: Difference between revisions

(→‎{{header|Euphoria}}: added image and SDL output with some notes.)
Line 1,723:
X X X
X X</pre>
 
=={{header|Run BASIC}}==
<lang runbasic>w = 320
h = 320
dim canvas(w,h)
for pts = 1 to 1000
x = (rnd(1) * 31) - 15
y = (rnd(1) * 31) - 15
r = x * x + y * y
if (r > 100) and (r < 225) then
x = int(x * 10 + w/2)
y = int(y * 10 + h/2)
canvas(x,y) = 1
end if
next pts
 
' -----------------------------
' display the graphic
' -----------------------------
graphic #g, w,h
for x = 1 to w
for y = 1 to h
if canvas(x,y) = 1 then #g "color green ; set "; x; " "; y else #g "color blue ; set "; x; " "; y
next y
next x
render #g
#g "flush"</lang>
 
=={{header|SystemVerilog}}==
Anonymous user