Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Polyspiral/FutureBasic/polyspiral.basic
Normal file
36
Task/Polyspiral/FutureBasic/polyspiral.basic
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
local fn DoIt
|
||||
NSInteger i, t
|
||||
double length, incr, x1, y1, x2, y2, twopi, angle, w, h
|
||||
|
||||
pen 2.0, fn ColorRed, NSLineCapStyleButt, NULL, 0
|
||||
|
||||
incr = 0 : twopi = 2 * pi
|
||||
w = 600 : h = 600
|
||||
|
||||
t = 150
|
||||
while ( t > 0 )
|
||||
incr = ( incr + 0.05 mod twopi )
|
||||
x1 = w / 2
|
||||
y1 = h / 2
|
||||
length = 1.0
|
||||
angle = incr
|
||||
line to x1, y1
|
||||
cls
|
||||
for i = 1 to 300
|
||||
x2 = x1 + cos( angle ) * length
|
||||
y2 = y1 + sin( angle ) * length
|
||||
line to x1, y1 to x2, y2
|
||||
x1 = x2 : y1 = y2
|
||||
length = length + 1.0
|
||||
angle = ( angle + incr mod twopi )
|
||||
next
|
||||
t--
|
||||
wend
|
||||
end fn
|
||||
|
||||
window 1, @"Rosetta Code Polyspiral", fn CGRectMake( 0, 0, 600, 600 )
|
||||
WindowSetBackgroundColor( 1, fn ColorBlack )
|
||||
|
||||
fn DoIt
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue