|
VR try
Jan 16, 2019 20:11:20 GMT
Post by bluatigro on Jan 16, 2019 20:11:20 GMT
error : float invalid [/p][p] dim triangle( 100 , 12 ) , pnt( 255 , 2 ) global tritel WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , pi pi = atn( 1 ) * 4 winx = WindowWidth winy = WindowHeight nomainwin open "vr jb2" for graphics as #m #m "trapclose [quit]" call setpoint 0,100,100,100 call setpoint 1,-100,-100,100 call setpoint 2,-100,100,-100 call setpoint 3,100,-100,-100 call tri 0,1,2,rgb(255,0,0) call tri 0,1,3,rgb(0,255,0) call tri 0,2,3,rgb(0,0,255) call tri 1,2,3,rgb(255,255,0) timer 250 , [tick] wait [tick] s = sin( rad( 1 ) ) c = cos( rad( 1 ) ) for i = 0 to tritel for p = 0 to 11 step 3 x = triangle( i , p ) z = triangle( i , p + 2 ) hx = x * c - z * s hz = x * s + z * c triangle( i , p ) = hx triangle( i , p + 2 ) = hz next p next i sort triangle() , 0 , tritel - 1 , 11 for i = 0 to tritel - 1 call drawtriangle i next i wait [quit] close #m end function rgb(r,g,b) r = r and 255 g = g and 255 b = b and 255 rgb = r + g * 256 + b * 256 ^ 2 end function function rad( deg ) rad = deg * pi / 180 end function sub setpoint no , x , y , z pnt( no , 0 ) = x pnt( no , 1 ) = y pnt( no , 2 ) = z end sub sub tri p1 , p2 , p3 , kl triangle( tritel , 0 ) = pnt( p1 , 0 ) triangle( tritel , 1 ) = pnt( p1 , 1 ) triangle( tritel , 2 ) = pnt( p1 , 2 ) triangle( tritel , 3 ) = pnt( p2 , 0 ) triangle( tritel , 4 ) = pnt( p2 , 1 ) triangle( tritel , 5 ) = pnt( p2 , 2 ) triangle( tritel , 6 ) = pnt( p3 , 0 ) triangle( tritel , 7 ) = pnt( p3 , 1 ) triangle( tritel , 8 ) = pnt( p3 , 2 ) x1 = pnt( p1 , 0 ) y1 = pnt( p1 , 1 ) z1 = pnt( p1 , 2 ) x2 = pnt( p2 , 0 ) y2 = pnt( p2 , 1 ) z2 = pnt( p2 , 2 ) x3 = pnt( p3 , 0 ) y3 = pnt( p3 , 1 ) z3 = pnt( p3 , 2 ) triangle( tritel , 9 ) = ( x1 + x2 + x3 ) / 3 triangle( tritel , 10 ) = ( y1 + y2 + y3 ) / 3 triangle( tritel , 11 ) = ( z1 + z2 + z3 ) / 3 triangle( tritel , 12 ) = kl tritel = tritel + 1 end sub sub drawtriangle no x1 = winx / 2 + triangle( no , 0 ) y1 = winy / 2 - triangle( no , 1 ) x2 = winx / 2 + triangle( no , 3 ) y2 = winy / 2 - triangle( no , 4 ) x3 = winx / 2 + triangle( no , 6 ) y3 = winy / 2 - triangle( no , 7 ) kl = triangle( no , 12 ) r = int( kl ) and 255 g = int( kl / 256 ) and 255 b = int( kl / 256 ^ 2 ) and 255 #m "color ";r;" ";g;" ";b if y1 = y2 then y1 = y1 - 1e-6 if y2 = y3 then y3 = y3 + 1e-6 if y1 > y3 then call swap y1 , y3 call swap x1 , x3 end if if y1 > y2 then call swap y1 , y2 call swap x1 , x2 end if if y2 > y3 then call swap y2 , y3 call swap x2 , y3 end if for i = y1 to y3 a = x1 + ( x3 - x1 ) * (i-y1) / ( y3 - y1 ) if i < y2 then b = x1 + ( x2 - x1 ) * (i-y1) / ( y2 - y1 ) else b = x2 + ( x3 - x2 ) * (i-y2) / ( y3 - y2 ) end if #m "down" #m "line " ; a ; " " ; i _ ; " " ; b ; " " ; i #m "up" next i end sub sub swap byref a , byref b h = a a = b b = h end sub [/p][p]
|
|
|
VR try
Jan 25, 2019 17:54:20 GMT
Post by zzz000abc on Jan 25, 2019 17:54:20 GMT
hi, bluatigro check the following code at line numbers 24,37 and 123. You forgot timer 0, close #m and finally where have you defined/initialized tritel? tritel might be causing the floating error
'[/p][p] dim triangle( 100 , 12 ) , pnt( 255 , 2 ) global tritel WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , pi pi = atn( 1 ) * 4 winx = WindowWidth winy = WindowHeight nomainwin open "vr jb2" for graphics as #m #m "trapclose [quit]" call setpoint 0,100,100,100 call setpoint 1,-100,-100,100 call setpoint 2,-100,100,-100 call setpoint 3,100,-100,-100 call tri 0,1,2,rgb(255,0,0) call tri 0,1,3,rgb(0,255,0) call tri 0,2,3,rgb(0,0,255) call tri 1,2,3,rgb(255,255,0) timer 250 , [tick] wait [tick] timer 0 'line number 24 s = sin( rad( 1 ) ) c = cos( rad( 1 ) ) for i = 0 to tritel for p = 0 to 11 step 3 x = triangle( i , p ) z = triangle( i , p + 2 ) hx = x * c - z * s hz = x * s + z * c triangle( i , p ) = hx triangle( i , p + 2 ) = hz next p next i ' sort triangle() , 0 , tritel - 1 , 11 'line number 37 for i = 0 to tritel - 1 ' call drawtriangle i print i,tritel -1 next i wait [quit] close #m end function rgb(r,g,b) r = r and 255 g = g and 255 b = b and 255 rgb = r + g * 256 + b * 256 ^ 2 end function function rad( deg ) rad = deg * pi / 180 end function sub setpoint no , x , y , z pnt( no , 0 ) = x pnt( no , 1 ) = y pnt( no , 2 ) = z end sub sub tri p1 , p2 , p3 , kl triangle( tritel , 0 ) = pnt( p1 , 0 ) triangle( tritel , 1 ) = pnt( p1 , 1 ) triangle( tritel , 2 ) = pnt( p1 , 2 ) triangle( tritel , 3 ) = pnt( p2 , 0 ) triangle( tritel , 4 ) = pnt( p2 , 1 ) triangle( tritel , 5 ) = pnt( p2 , 2 ) triangle( tritel , 6 ) = pnt( p3 , 0 ) triangle( tritel , 7 ) = pnt( p3 , 1 ) triangle( tritel , 8 ) = pnt( p3 , 2 ) x1 = pnt( p1 , 0 ) y1 = pnt( p1 , 1 ) z1 = pnt( p1 , 2 ) x2 = pnt( p2 , 0 ) y2 = pnt( p2 , 1 ) z2 = pnt( p2 , 2 ) x3 = pnt( p3 , 0 ) y3 = pnt( p3 , 1 ) z3 = pnt( p3 , 2 ) triangle( tritel , 9 ) = ( x1 + x2 + x3 ) / 3 triangle( tritel , 10 ) = ( y1 + y2 + y3 ) / 3 triangle( tritel , 11 ) = ( z1 + z2 + z3 ) / 3 triangle( tritel , 12 ) = kl tritel = tritel + 1 end sub sub drawtriangle no x1 = winx / 2 + triangle( no , 0 ) y1 = winy / 2 - triangle( no , 1 ) x2 = winx / 2 + triangle( no , 3 ) y2 = winy / 2 - triangle( no , 4 ) x3 = winx / 2 + triangle( no , 6 ) y3 = winy / 2 - triangle( no , 7 ) kl = triangle( no , 12 ) r = int( kl ) and 255 g = int( kl / 256 ) and 255 b = int( kl / 256 ^ 2 ) and 255 #m "color ";r;" ";g;" ";b if y1 = y2 then y1 = y1 - 1e-6 if y2 = y3 then y3 = y3 + 1e-6 if y1 > y3 then call swap y1 , y3 call swap x1 , x3 end if if y1 > y2 then call swap y1 , y2 call swap x1 , x2 end if if y2 > y3 then call swap y2 , y3 call swap x2 , y3 end if for i = y1 to y3 a = x1 + ( x3 - x1 ) * (i-y1) / ( y3 - y1 ) if i < y2 then b = x1 + ( x2 - x1 ) * (i-y1) / ( y2 - y1 ) else b = x2 + ( x3 - x2 ) * (i-y2) / ( y3 - y2 ) end if #m "down" #m "line " ; a ; " " ; i _ ; " " ; b ; " " ; i #m "up" next i close #m 'line number 123 end sub sub swap byref a , byref b h = a a = b b = h end sub
|
|
|
VR try
Jan 25, 2019 19:08:28 GMT
Post by zzz000abc on Jan 25, 2019 19:08:28 GMT
now your code showing somthing colorful when it is run.check the lines 4 and 21
'[/p][p] dim triangle( 100 , 12 ) , pnt( 255 , 2 ) global tritel tritel=50 'line 4 WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , pi pi = atn( 1 ) * 4 winx = WindowWidth winy = WindowHeight 'nomainwin open "vr jb2" for graphics as #m #m "trapclose [quit]" call setpoint 0,100,100,100 call setpoint 1,-100,-100,100 call setpoint 2,-100,100,-100 call setpoint 3,100,-100,-100 call tri 0,1,2,rgb(255,0,0) call tri 0,1,3,rgb(0,255,0) call tri 0,2,3,rgb(0,0,255) call tri 0,2,3,rgb(255,255,0) 'line 21 timer 250 , [tick] wait [tick] timer 0 s = sin( rad( 1 ) ) c = cos( rad( 1 ) ) for i = 0 to tritel for p = 0 to 11 step 3 x = triangle( i , p ) z = triangle( i , p + 2 ) hx = x * c - z * s hz = x * s + z * c triangle( i , p ) = hx triangle( i , p + 2 ) = hz next p next i ' sort triangle() , 0 , tritel - 1 , 11 for i = 0 to tritel - 1 call drawtriangle i next i wait [quit] close #m end function rgb(r,g,b) r = r and 255 g = g and 255 b = b and 255 rgb = r + g * 256 + b * 256 ^ 2 end function function rad( deg ) rad = deg * pi / 180 end function sub setpoint no , x , y , z pnt( no , 0 ) = x pnt( no , 1 ) = y pnt( no , 2 ) = z end sub sub tri p1 , p2 , p3 , kl triangle( tritel , 0 ) = pnt( p1 , 0 ) triangle( tritel , 1 ) = pnt( p1 , 1 ) triangle( tritel , 2 ) = pnt( p1 , 2 ) triangle( tritel , 3 ) = pnt( p2 , 0 ) triangle( tritel , 4 ) = pnt( p2 , 1 ) triangle( tritel , 5 ) = pnt( p2 , 2 ) triangle( tritel , 6 ) = pnt( p3 , 0 ) triangle( tritel , 7 ) = pnt( p3 , 1 ) triangle( tritel , 8 ) = pnt( p3 , 2 ) x1 = pnt( p1 , 0 ) y1 = pnt( p1 , 1 ) z1 = pnt( p1 , 2 ) x2 = pnt( p2 , 0 ) y2 = pnt( p2 , 1 ) z2 = pnt( p2 , 2 ) x3 = pnt( p3 , 0 ) y3 = pnt( p3 , 1 ) z3 = pnt( p3 , 2 ) triangle( tritel , 9 ) = ( x1 + x2 + x3 ) / 3 triangle( tritel , 10 ) = ( y1 + y2 + y3 ) / 3 triangle( tritel , 11 ) = ( z1 + z2 + z3 ) / 3 triangle( tritel , 12 ) = kl tritel = tritel + 1 end sub sub drawtriangle no x1 = winx / 2 + triangle( no , 0 ) y1 = winy / 2 - triangle( no , 1 ) x2 = winx / 2 + triangle( no , 3 ) y2 = winy / 2 - triangle( no , 4 ) x3 = winx / 2 + triangle( no , 6 ) y3 = winy / 2 - triangle( no , 7 ) kl = triangle( no , 12 ) r = int( kl ) and 255 g = int( kl / 256 ) and 255 b = int( kl / 256 ^ 2 ) and 255 #m "color ";r;" ";g;" ";b if y1 = y2 then y1 = y1 - 1e-6 if y2 = y3 then y3 = y3 + 1e-6 if y1 > y3 then call swap y1 , y3 call swap x1 , x3 end if if y1 > y2 then call swap y1 , y2 call swap x1 , x2 end if if y2 > y3 then call swap y2 , y3 call swap x2 , y3 end if for i = y1 to y3 a = x1 + ( x3 - x1 ) * (i-y1) / ( y3 - y1 ) if i < y2 then b = x1 + ( x2 - x1 ) * (i-y1) / ( y2 - y1 ) else b = x2 + ( x3 - x2 ) * (i-y2) / ( y3 - y2 ) end if #m "down" #m "line " ; a ; " " ; i _ ; " " ; b ; " " ; i #m "up" next i 'close #m end sub sub swap byref a , byref b h = a a = b b = h end sub
|
|
|
VR try
Jan 28, 2019 13:03:30 GMT
Post by bluatigro on Jan 28, 2019 13:03:30 GMT
update : added some OOP to weet out mistakes
error : my color's act strange . why ?
'' bluatigro 28 jan 2019 '' VR jb2 try dim triangle( 100 , 12 ) , pnt( 255 , 2 ) global tritel 'line 4 WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , pi , key$ global t.x1,t.y1,t.z1,t.x2,t.y2,t.z2,t.x3,t.y3,t.kl,t.lx,t.ly,t.lz global p.x,p.y,p.z t.x1 = 0 t.y1 = 1 t.z1 = 2 t.x2 = 3 t.y2 = 4 t.z2 = 5 t.x3 = 6 t.y3 = 7 t.z3 = 8 t.kl = 9 t.led.x = 10 t.led.y = 11 t.led.z = 12 p.x = 0 p.y = 1 p.z = 2 global black,red,green,yellow global blue,magenta,cyan,white black = rgb( 0, 0, 0) red = rgb(255, 0, 0) green = rgb( 0,255, 0) yellow = rgb(255,255, 0) blue = rgb( 0, 0,255) magenta = rgb(255, 0,255) cyan = rgb( 0,255,255) white = rgb(255,255,255)
pi = atn( 1 ) * 4
winx = WindowWidth winy = WindowHeight nomainwin open "VR for justbasic 2.0 ." for graphics as #m #m "trapclose [quit]" #m "when characterInput [key]" #m "setfocus" tritel = 0 call setpoint 0,100,100,100 call setpoint 1,-100,-100,100 call setpoint 2,-100,100,-100 call setpoint 3,100,-100,-100 call tri 0 , 1 , 2 , red call tri 0 , 1 , 3 , green call tri 0 , 2 , 3 , blue call tri 1 , 2 , 3 , yellow notice "push [esc] to end VR ." timer 1000 , [tick] wait [key] key$ = right$( Inkey$ , 1 ) if key$ <> chr$( 27 ) then wait [quit] close #m end [tick] scan #m "cls" s = sin( rad( 10 ) ) c = cos( rad( 10 ) ) for i = 0 to tritel for p = 0 to 11 step 3 x = triangle( i , p ) z = triangle( i , p + 2 ) hx = x * c - z * s hz = x * s + z * c triangle( i , p ) = hx triangle( i , p + 2 ) = hz next p next i sort triangle() , 0 , tritel - 1 , t.led.z for i = 0 to tritel - 1 call drawtriangle i next i wait function rgb(r,g,b) r = r and 255 g = g and 255 b = b and 255 rgb = r + g * 256 + b * 256 ^ 2 end function function rad( deg ) rad = deg * pi / 180 end function sub setpoint no , x , y , z pnt( no , p.x ) = x pnt( no , p.y ) = y pnt( no , p.z ) = z end sub sub tri p1 , p2 , p3 , kl triangle( tritel , t.x1 ) = pnt( p1 , p.x ) triangle( tritel , t.y1 ) = pnt( p1 , p.y ) triangle( tritel , t.z1 ) = pnt( p1 , p.z ) triangle( tritel , t.x2 ) = pnt( p2 , p.x ) triangle( tritel , t.y2 ) = pnt( p2 , p.y ) triangle( tritel , t.z2 ) = pnt( p2 , p.z ) triangle( tritel , t.x3 ) = pnt( p3 , p.x ) triangle( tritel , t.y3 ) = pnt( p3 , p.y ) triangle( tritel , t.z3 ) = pnt( p3 , p.z ) x1 = pnt( p1 , p.x ) y1 = pnt( p1 , p.y ) z1 = pnt( p1 , p.z ) x2 = pnt( p2 , p.x ) y2 = pnt( p2 , p.y ) z2 = pnt( p2 , p.z ) x3 = pnt( p3 , p.x ) y3 = pnt( p3 , p.y ) z3 = pnt( p3 , p.z ) triangle( tritel , t.led.x ) = ( x1 + x2 + x3 ) / 3 triangle( tritel , t.led.y ) = ( y1 + y2 + y3 ) / 3 triangle( tritel , t.led.z ) = ( z1 + z2 + z3 ) / 3 triangle( tritel , t.kl ) = kl tritel = tritel + 1 end sub sub drawtriangle no x1 = int( winx / 2 + triangle( no , t.x1 ) ) y1 = int( winy / 2 - triangle( no , t.y1 ) ) x2 = int( winx / 2 + triangle( no , t.x2 ) ) y2 = int( winy / 2 - triangle( no , t.y2 ) ) x3 = int( winx / 2 + triangle( no , t.x3 ) ) y3 = int( winy / 2 - triangle( no , t.y3 ) ) kl = triangle( no , t.kl ) r = int( kl ) and 255 g = int( kl / 256 ) and 255 b = int( kl / 256 ^ 2 ) and 255 #m "color " ; r ; " " ; g ; " " ; b if y1 > y3 then call swap y1 , y3 call swap x1 , x3 end if if y1 > y2 then call swap y1 , y2 call swap x1 , x2 end if if y2 > y3 then call swap y2 , y3 call swap x2 , y3 end if if near( y1 , y2 , 1e-5 ) then y1 = y1 - 1e-4 if near( y2 , y3 , 1e-5 ) then y3 = y3 + 1e-4 for i = y1 to y3 a = x1 + ( x3 - x1 ) * ( i - y1 ) / ( y3 - y1 ) if i < y2 then b = x1 + ( x2 - x1 ) * ( i - y1 ) / ( y2 - y1 ) else b = x2 + ( x3 - x2 ) * ( i - y2 ) / ( y3 - y2 ) end if #m "down" #m "line " ; a ; " " ; i _ ; " " ; b ; " " ; i #m "up" next i 'close #m end sub sub swap byref a , byref b h = a a = b b = h end sub function near( a , b , c ) near = abs( a - b ) < c end function
|
|
|
VR try
Jan 28, 2019 13:08:40 GMT
Post by bluatigro on Jan 28, 2019 13:08:40 GMT
update : color error fixed
error : my red triangle looks and moves not good
'' bluatigro 28 jan 2019 '' VR jb2 try dim triangle( 100 , 12 ) , pnt( 255 , 2 ) global tritel 'line 4 WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , pi , key$ global t.x1,t.y1,t.z1,t.x2,t.y2,t.z2,t.x3,t.y3,t.kl,t.led.x,t.led.y,t.led.z global p.x,p.y,p.z t.x1 = 0 t.y1 = 1 t.z1 = 2 t.x2 = 3 t.y2 = 4 t.z2 = 5 t.x3 = 6 t.y3 = 7 t.z3 = 8 t.kl = 12 t.led.x = 9 t.led.y = 10 t.led.z = 11 p.x = 0 p.y = 1 p.z = 2 global black,red,green,yellow global blue,magenta,cyan,white black = rgb( 0, 0, 0) red = rgb(255, 0, 0) green = rgb( 0,255, 0) yellow = rgb(255,255, 0) blue = rgb( 0, 0,255) magenta = rgb(255, 0,255) cyan = rgb( 0,255,255) white = rgb(255,255,255)
pi = atn( 1 ) * 4
winx = WindowWidth winy = WindowHeight nomainwin open "VR for justbasic 2.0 ." for graphics as #m #m "trapclose [quit]" #m "when characterInput [key]" #m "setfocus" tritel = 0 call setpoint 0,100,100,100 call setpoint 1,-100,-100,100 call setpoint 2,-100,100,-100 call setpoint 3,100,-100,-100 call tri 0 , 1 , 2 , red call tri 0 , 1 , 3 , green call tri 0 , 2 , 3 , blue call tri 1 , 2 , 3 , yellow notice "push [esc] to end VR ." timer 1000 , [tick] wait [key] key$ = right$( Inkey$ , 1 ) if key$ <> chr$( 27 ) then wait [quit] close #m end [tick] scan #m "cls" s = sin( rad( 10 ) ) c = cos( rad( 10 ) ) for i = 0 to tritel for p = 0 to 11 step 3 x = triangle( i , p ) z = triangle( i , p + 2 ) hx = x * c - z * s hz = x * s + z * c triangle( i , p ) = hx triangle( i , p + 2 ) = hz next p next i sort triangle() , 0 , tritel - 1 , t.led.z for i = 0 to tritel - 1 call drawtriangle i next i wait function rgb(r,g,b) r = r and 255 g = g and 255 b = b and 255 rgb = r + g * 256 + b * 256 ^ 2 end function function rad( deg ) rad = deg * pi / 180 end function sub setpoint no , x , y , z pnt( no , p.x ) = x pnt( no , p.y ) = y pnt( no , p.z ) = z end sub sub tri p1 , p2 , p3 , kl triangle( tritel , t.x1 ) = pnt( p1 , p.x ) triangle( tritel , t.y1 ) = pnt( p1 , p.y ) triangle( tritel , t.z1 ) = pnt( p1 , p.z ) triangle( tritel , t.x2 ) = pnt( p2 , p.x ) triangle( tritel , t.y2 ) = pnt( p2 , p.y ) triangle( tritel , t.z2 ) = pnt( p2 , p.z ) triangle( tritel , t.x3 ) = pnt( p3 , p.x ) triangle( tritel , t.y3 ) = pnt( p3 , p.y ) triangle( tritel , t.z3 ) = pnt( p3 , p.z ) x1 = pnt( p1 , p.x ) y1 = pnt( p1 , p.y ) z1 = pnt( p1 , p.z ) x2 = pnt( p2 , p.x ) y2 = pnt( p2 , p.y ) z2 = pnt( p2 , p.z ) x3 = pnt( p3 , p.x ) y3 = pnt( p3 , p.y ) z3 = pnt( p3 , p.z ) triangle( tritel , t.led.x ) = ( x1 + x2 + x3 ) / 3 triangle( tritel , t.led.y ) = ( y1 + y2 + y3 ) / 3 triangle( tritel , t.led.z ) = ( z1 + z2 + z3 ) / 3 triangle( tritel , t.kl ) = kl tritel = tritel + 1 end sub sub drawtriangle no x1 = int( winx / 2 + triangle( no , t.x1 ) ) y1 = int( winy / 2 - triangle( no , t.y1 ) ) x2 = int( winx / 2 + triangle( no , t.x2 ) ) y2 = int( winy / 2 - triangle( no , t.y2 ) ) x3 = int( winx / 2 + triangle( no , t.x3 ) ) y3 = int( winy / 2 - triangle( no , t.y3 ) ) kl = triangle( no , t.kl ) r = int( kl ) and 255 g = int( kl / 256 ) and 255 b = int( kl / 256 ^ 2 ) and 255 #m "color " ; r ; " " ; g ; " " ; b if y1 > y3 then call swap y1 , y3 call swap x1 , x3 end if if y1 > y2 then call swap y1 , y2 call swap x1 , x2 end if if y2 > y3 then call swap y2 , y3 call swap x2 , y3 end if if near( y1 , y2 , 1e-5 ) then y1 = y1 - 1e-4 if near( y2 , y3 , 1e-5 ) then y3 = y3 + 1e-4 for i = y1 to y3 a = x1 + ( x3 - x1 ) * ( i - y1 ) / ( y3 - y1 ) if i < y2 then b = x1 + ( x2 - x1 ) * ( i - y1 ) / ( y2 - y1 ) else b = x2 + ( x3 - x2 ) * ( i - y2 ) / ( y3 - y2 ) end if #m "down" #m "line " ; a ; " " ; i _ ; " " ; b ; " " ; i #m "up" next i 'close #m end sub sub swap byref a , byref b h = a a = b b = h end sub function near( a , b , c ) near = abs( a - b ) < c end function
|
|