Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
28
Task/Hilbert-curve/FutureBasic/hilbert-curve.basic
Normal file
28
Task/Hilbert-curve/FutureBasic/hilbert-curve.basic
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#define ORDER 64
|
||||
|
||||
_window = 1
|
||||
|
||||
void local fn BuildWindow
|
||||
CGRect r = fn CGRectMake( 0, 0, 651, 661 )
|
||||
window _window, @"Order 64 Hilbert Curve In FutureBasic", r, NSWindowStyleMaskTitled
|
||||
WindowSetBackgroundColor( _window, fn ColorBlack )
|
||||
end fn
|
||||
|
||||
void local fn HilbertCurve( x as long, y as long, lg as long, i1 as long, i2 as long )
|
||||
if ( lg == 1 )
|
||||
line to ( ORDER-x ) * 10, ( ORDER-y ) * 10
|
||||
exit fn
|
||||
end if
|
||||
lg = lg / 2
|
||||
fn HilbertCurve( x+i1*lg, y+i1*lg, lg, i1, 1-i2 )
|
||||
pen 2.0
|
||||
fn HilbertCurve( x+i2*lg, y+(1-i2)*lg, lg, i1, i2 )
|
||||
fn HilbertCurve( x+(1-i1)*lg, y+(1-i1)*lg, lg, i1, i2 )
|
||||
fn HilbertCurve( x+(1-i2)*lg, y+i2*lg, lg, 1-i1, i2 )
|
||||
end fn
|
||||
|
||||
fn BuildWindow
|
||||
pen -2.0, fn ColorGreen
|
||||
fn HilbertCurve( 0, 0, ORDER, 0, 0 )
|
||||
|
||||
HandleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue