21 lines
464 B
Plaintext
21 lines
464 B
Plaintext
//Constrained random points on a circle
|
|
//https://rosettacode.org/wiki/Constrained_random_points_on_a_circle
|
|
// Translated from Yabasic to FutureBASIC
|
|
|
|
short i,x,y,r
|
|
window 1,@"Circle",fn CGRectMake(0, 0, 100, 100),NSWindowStyleMaskTitled
|
|
windowcenter(1)
|
|
WindowSetBackgroundColor(1,fn ColorBlack)
|
|
for i = 1 to 100
|
|
do
|
|
x = rnd(30)-15
|
|
y = rnd(30)-15
|
|
r = fn sqrt(x*x + y*y)
|
|
until 10 <= r and r <= 15
|
|
|
|
oval fill (x+50, y+50,1,1)
|
|
next i
|
|
|
|
|
|
handleevents
|