Vibrating rectangles: Difference between revisions

Initial FutureBasic task solution added
(Initial FutureBasic task solution added)
Line 362:
{ normal-title-bar close-button minimize-button } }
} <vibrating-gadget> >>gadgets ;</syntaxhighlight>
 
 
 
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">
_window = 1
 
void local fn BuildWindow
block NSUInteger i = 0
block double red, green, blue
block CGRect r = fn CGRectMake( 0, 0, 410, 410 )
window _window, @"Vibrating Rectangles", r, NSWindowStyleMaskTitled + NSWindowStyleMaskClosable + NSWindowStyleMaskMiniaturizable
r = fn CGRectMake( 20, 20, 360, 360 )
timerbegin, 0.3, YES
i++
cln red = (((double)arc4random()/0x100000000));
cln green = (((double)arc4random()/0x100000000));
cln blue = (((double)arc4random()/0x100000000));
timerbegin, 0.2, NO
rect fill r, fn ColorWithRGB( red, green, blue, 1.0 )
timerend
rect fill r, fn ColorWithRGB( 0.3, 0.3, 0.3, 1.0 )
r = fn CGRectInset( r, 3, 3 )
if i mod 60 == 0 then r = fn CGRectMake( 20, 20, 360, 360 )
timerend
end fn
 
void local fn DoDialog( ev as long, tag as long, wnd as long )
select ( ev )
case _windowWillClose : end
end select
end fn
 
random
on dialog fn DoDialog
 
fn BuildWindow
 
HandleEvents
</syntaxhighlight>
[[file:Vibrating_Rectangles_FutureBasic.gif]]
 
 
=={{header|Go}}==
715

edits