Vibrating rectangles: Difference between revisions
m
→{{header|Wren}}: Changed to Wren S/H
m (→{{header|Wren}}: Changed to Wren S/H) |
|||
(6 intermediate revisions by 2 users not shown) | |||
Line 297:
=={{header|EasyLang}}==
[https://easylang.dev/show/#cod=hY/LCoAgEEX3fsXdizJGLYL6mOgBgimotPDrY6w2bdzM3HMuDEzwyPbcowCQCtSMjqM9mCYQw1PN6MeX1uBCRFz8Zn2GISIoGC41jzNcOwZ2qXybvbO+etnw8udVw3936iMg3Qkt3ixu Run it]
<syntaxhighlight
if sz
color randint 1000 - 1
.
move 50 - sz 50 - sz▼
line 50 + sz 50
line 50
line 50 - sz 50
▲ timer 0.2
timer 0.2
.
timer 0
</syntaxhighlight>
=={{header|Factor}}==
Line 362 ⟶ 364:
{ normal-title-bar close-button minimize-button } }
} <vibrating-gadget> >>gadgets ;</syntaxhighlight>
=={{header|FutureBasic}}==
Note: The compiled macOS app runs faster than the attached GIF with a smoother fade.
<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}}==
Line 1,295 ⟶ 1,341:
=={{header|Wren}}==
{{libheader|DOME}}
<syntaxhighlight lang="
import "dome" for Window
|