|
Post by Beaker on Jan 26, 2004 15:59:41 GMT
; blitz tree
Type node Field branch.node[2] Field nkey$ Field nhandle$ End Type
Global tree.node
Function AddNode(tkey$,thandle) n.node=New node n\nkey=tkey n\nhandle=thandle If tree=Null tree=n:Return t.node=tree Repeat b=0 If tkey>t\nkey b=1 If t\branch=Null t\branch=n Return Else t=t\branch EndIf Forever End Function
Function FindNode(tkey$) t.node=tree While t<>Null ; b=0 If tkey=t\nkey Return t\nhandle If tkey>t\nkey t=t\branch[1] Else t=t\branch[0] EndIf Wend End Function
For i=1 To 50 AddNode i,i*5 Next
DebugLog FindNode(30)
Stop End
|
|
|
Post by Beaker on Jan 26, 2004 16:05:38 GMT
And this one:
Const DEBUGON = True Graphics 640,480
SetBuffer BackBuffer()
Color 255,255,255
While Not KeyDown(1)
old_random=Rand(0,100)
For x=0 To 31
random=Rand(0,100) For n#=0 To 1 Step .01
Plot (x*20)+(n*20),(linear_interpolate(old_random,random,n))+50
Plot (x*20)+(n*20),(cosine_interpolate(old_random,random,n))+200
Next
old_random=random
Next
Text 0,20,"Linear Interpolation"
Text 0,170,"Cosine Interpolation" WaitKey Flip:Cls Wend
End
Function Linear_Interpolate#(a#, b#, x#)
Return a*(1-x) + b*x
End Function
Function cosine_interpolate#(a#, b#, x#)
f#=(1-Cos(x*180))/2
Return a*(1-f)+(b*f)
End Function
|
|
|
Post by Beaker on Jan 26, 2004 16:13:50 GMT
This one works fine tho:
Const DEBUGON = True ; Paints a random abstract picture ; Uses curve function: ; Syntax: Curve (start X, start Y, End X, End Y, control point X, control point Y) ; Give it time to build up (> 2 mins) and you'll ; see a great artist at work with great control over form and colour (or color) ; by Beaker
Const w = 1024 Const h = 768 Const lines = 10 Dim ords(lines, 9)
Graphics w, h
;SetBuffer FrontBuffer() SetBuffer BackBuffer() Text w/2,h/2, "please wait..."
SeedRnd MilliSecs()
For f = 1 To lines For g = 1 To 6 ords(f,g) = Rnd(h) Next For g = 7 To 9 ords(f,g) = Rnd(255) Next Next
;SetBuffer BackBuffer() flipped = False timer = MilliSecs()
Repeat For f = 1 To lines For g = 1 To 9 ords(f,g) = ords(f,g) + Rnd(2)-1 If ords(f,g) = 255 Then ords(f,g) = 254 If ords(f,g) = 0 Then ords(f,g) = 1 Next
Color ords(f, 7), ords(f, 8), ords(f, 9) Curve (ords(f, 1), ords(f, 2), ords(f, 3), ords(f, 4), ords(f, 5), ords(f, 6)) ; curve control point is last
Next
;If MilliSecs()-timer > 1000 And flipped = False Flip ; SetBuffer FrontBuffer() ; flipped = True ; LockBuffer ;EndIf ;Curve (50,50, 200,200, 0,300) ; curve control point is last Until KeyDown(1) ;UnlockBuffer ;WaitKey
End
Function curve (x0,y0, x2,y2, x1,y1) ; curve control point is middle divide(x0,y0, x1,y1, x2,y2, 4) ; last no shouldn't go much above 6 End Function
Function divide(x0,y0, x1,y1, x2,y2, counter) ; curve control point is middle ;counter = counter - 1 If counter = 0
Line x0, y0, x2, y2 ; Oval x2, y2, 5, 5 ; Rect x2, y2, 5, 5
Return True Else xsplit = (x0+x1)/2 ysplit = (y0+y1)/2
xsplit2 = (x1+x2)/2 ysplit2 = (y1+y2)/2
sendX = (xsplit + xsplit2)/2 sendY = (ysplit + ysplit2)/2 divide (x0, y0, xsplit, ysplit, sendX, sendY, counter-1) divide (x2, y2, xsplit2, ysplit2, sendX, sendY, counter-1)
Return False EndIf End Function
|
|
|
Post by Beaker on Jan 26, 2004 16:19:48 GMT
Problem areas are: Stop Debuglog If a=b c=4 ; If a=b Then c=4 works fine
If tree=Null tree=n:Return
had to become
If tree=Null then tree=n:Return 0
|
|
|
Post by Paul Rene Jørgensen on Feb 4, 2004 21:15:40 GMT
The if/then problem should be fixed in the next release.
|
|
|
Post by Beaker on Jun 8, 2004 22:36:46 GMT
It's worth trying these again on the new version. I only managed to get the last one to translate.
|
|
|
Post by zhanhuichuangg on Oct 13, 2011 2:25:27 GMT
Standing here, white timberland boots faces a magnificent vista, opening up on this city¡¯s special beauty and history. At the end of this open mall are those shrines to the giants on whose shoulders we stand. Directly in front of me, the monument to a monumental timberland chukka boots men. George Washington, father of our country. A man of humility who came to greatness reluctantly. He led timberland 14 inch women out of revolutionary victory into infant nationhood. Off to one side, the stately memorial to Thomas Jefferson. The Declaration of timberland 6 inch men's boots flames with his eloquence. And then beyond the Reflecting Pool, the dignified columns of the Lincoln Memorial. Whoever would understand in his heart the meaning of America will find timberland 6 inch premiumin the life of Abraham Lincoln. Beyond those moments -- those monuments to heroism is the Potomac River, and on the far shore the sloping hills of timberland mens classic 3-eye, with its row upon row of simple white markers bearing crosses or Stars of David. They add up to only a tiny fraction of the price that timberland boots for men has been paid for our freedom. The crisis we are facing today does not require of us the kind of sacrifice that timberland boots uk and so many thousands of others were called upon to make. It does require, however, our best effort, and our willingness to believe in ourselves and to believe in our capacity to perform great deeds; to believe that together with timberland 14 inch premium boots wheat help we can and will resolve the problems which now confront us. I'm told that tens of thousands of timberland 6 inch womens boots are being held on this day; and for that I am deeply grateful. We are a nation under God, and I believe timberland boots black intended for us to be free. timberland boat shoeswomens timberland bootstimberland boots men ZHC
|
|