Vibrating rectangles: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(5 intermediate revisions by 2 users not shown)
Line 297:
=={{header|EasyLang}}==
 
[https://easylang.dev/show/#cod=hY/LCoAgEEX3fsXdizJGLYL6mOgBgimotPDrY6w2bdzM3HMuDEzwyPbcowCQCtSMjqM9mCYQw1PN6MeX1uBCRFz8Zn2GISIoGC41jzNcOwZ2qXybvbO+etnw8udVw3936iMg3Qkt3ixu Run it]
[https://easylang.online/show/#cod=y89TKMnMTS3iUlBQKK5S0LVVMAIxM9NAPBsFAxAHImWrYGIJ5SXn5+QXKRQl5qXk5yoYGhgYKOgqGILk9EBEbn5ZqoIpSAyoC0qDxHMy88Di2gTEtdHEdQmIw8wB+0PBQM+IS48LwQYA Run it]
 
<syntaxhighlight lang="text">on timer
on timer 0.2
sz -= 2
if sz <-= 02
if sz =< 490
color random 1000sz -= 149
color randint 1000 - 1
.
move 50 - sz 50 - sz
line move 50 +- sz 50 - sz
line 50 + sz 50 +- sz
line 50 -+ sz 50 + sz
line 50 - sz 50 -+ sz
move line 50 - sz 50 - sz
timer 0.2
timer 0.2
.
timer 0.2</syntaxhighlight>
</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="ecmascriptwren">import "graphics" for Canvas, Color
import "dome" for Window
 
9,486

edits