|
Post by tenochtitlanuk on Feb 8, 2019 17:16:26 GMT -5
This is a ( poorly thought out) suggested task on Rosetta Code. Gave me a couple of happy hours of coding to get this..
Will put my method up on my site in a few days- meanwhile anyone up for trying it out? Once you've got it working there are all sorts of variations to try- say triangles, or rotating each of the nested shapes, or different colour sequences...
|
|
|
Post by Rod on Feb 9, 2019 4:23:04 GMT -5
www.rosettacode.org/wiki/Vibrating_rectanglesprobably comes down to what they mean by "fading in" (edit Oh I see that John has it fading to the centre, just what was asked for.) This certainly vibrates! WindowWidth = DisplayWidth WindowHeight = DisplayHeight UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) midx=int(WindowWidth/2) midy=int(WindowHeight/2)
open "Vibrating Rectangle" for graphics_nsb as #1 #1 "down ;size 8; trapclose [quit]"
while 1 scan for n=0 to 255 step 10 #1 "place ";midx-n;" ";midy-n #1 "box ";midx+n;" ";midy+n #1 "color ";r;" ";g;" ";b r=r+(r<255)*10 g=g+(g<255)*10 b=b+(b<255)*10
next r=rnd(0)*255+1 g=rnd(0)*255+1 b=rnd(0)*255+1 wend wait
[quit] close #1 end
|
|
|
Post by tenochtitlanuk on Feb 9, 2019 6:31:23 GMT -5
Not sure if that is not the opposite of eye-catching!! Hope I 'fade away' with equally dramatic effects as I head for yet another birthday in my 70s!
I love LB's ability to do this kind of graphics so easily..
|
|
|
Post by tenochtitlanuk on Feb 10, 2019 15:46:37 GMT -5
|
|
|
Post by tenochtitlanuk on Feb 12, 2019 15:16:12 GMT -5
|
|