Moire Flower.bas

Something Aurel posted at The QB64 Edition, inspired this response by me.


'moire flower.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-17
' Public Domain
d = 1
while 1
cls
t = "Moire Flower"
at (xmax-txtw(t))/2, 10 : ? t
for a = 0 to ymax/2.5 step 10
circle xmax/2 - r/2, ymax/2 - r/2, a color 9
circle xmax/2 + r/2, ymax/2 + r/2, a color 12
next
showpage
delay 20
r += d
if r > 100 then r = 100 : d *= -1
if r < 0 then r = 0 : d *= -1
wend

Oh I like this better!

EDIT: I like this better yet!


'moire flower 2.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-18
' Public Domain
d = 1
while 1
cls
t = "Moire Flower #2"
at (xmax-txtw(t))/2, 10 : ? t
for i = 1 to 5
cx = xmax/2 + ymax/7*cos(i*2*pi/5)
cy = ymax/2 + ymax/7*sin(i*2*pi/5)
cx2 = xmax/2 + (ymax/7+r)*cos(i*2*pi/5)
cy2 = ymax/2 + (ymax/7+r)*sin(i*2*pi/5)
for a = 0 to ymax/5 step 5
circle cx, cy, a color 9
circle cx2,cy2, a color 12
next
next
showpage
delay 20
r += d
if r > 100 then r = 100 : d *= -1
if r < 0 then r = 0 : d *= -1
wend

I agree. The second one is better, mainly because, it better resembles a 'flower' than the previous version. It's just gone 7:30am and this was the version that my wife saw just before she left for work. The phrase she used was, "Oh boy". I am yet to fully understand her meaning. Even after 39 years of marriage, I still get it wrong... lol

I like it. Good job.

J

Could be worse ;-))

The words aren't as important as the accents, pauses, frequencies, duration's... well 39 years, you know.

Did you say something about a coffee dispenser?

oh boy...

Mmm... Coffee. Traditional Friday 6:30am breakfast, with my wife, at Macca's (Raisin toast and Coffee).. System is firing on all cycinders... lol

Dispenser? I researched the process of making a coffee (Barista style) and noticed it can be quite an 'art' to make the perfect cup. The type of bean; The density of the grind; Tamping of the grinds; Temperature; Steam pressure; Type of milk; Length of heating time etc. etc. Got me thinking about a program to simulate the procedure (something like an 'adventure game' - turn left or turn right etc) to produce an outcome. If the 'exact' procedure is followed - a 'perfect' cup otherwise a varying quality. I have no idea if this is viable (could be fun at least) or what shape it would take (text or graphic - primary application in text) or whether it would be a complete waste of time... lol Hmm... Maybe too much caffeine in the system? Nah. Can NEVER be too much... lol ... or maybe so...

J

Yep, another one!

' moire flower 3.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-18
' Public Domain
d = 1 : n = 3
while 1
cls
t = "Moire Flower #3"
at (xmax-txtw(t))/2, 10 : ? t
for i = 1 to n
cx = xmax/2 + ymax/5*cos(i*2*pi/n-pi/2)
cy = ymax/2 + ymax/5*sin(i*2*pi/n-pi/2)
cx2 = xmax/2 + (ymax/5-r)*cos(i*2*pi/n-pi/2)
cy2 = ymax/2 + (ymax/5-r)*sin(i*2*pi/n-pi/2)
for a = 0 to ymax/4 step 10
circle cx, cy, a color 9
circle cx2,cy2, a color 14
next
next
showpage
delay 20
r += d
if r > ymax/5 then r = ymax/5 : d *= -1 : delay 180
if r < 0 then r = 0 : d *= -1 : n += 1 : delay 180
wend

Please Sir, a Plasma version. OK:

' moire flower 4.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-19
' Public Domain
randomize timer
d = 1 : n = 3
resetPlasma
while 1
cls
color 15
t = "Moire Flower #4"
at (xmax-txtw(t))/2, 10 : ? t
for i = 1 to n
cx = xmax/2 + ymax/5*cos(i*2*pi/n-pi/2)
cy = ymax/2 + ymax/5*sin(i*2*pi/n-pi/2)
cx2 = xmax/2 + (ymax/5-r)*cos(i*2*pi/n-pi/2)
cy2 = ymax/2 + (ymax/5-r)*sin(i*2*pi/n-pi/2)
for a = 0 to ymax/4 step 10
setPlasma
circle cx, cy, a
circle cx2,cy2, a
next
next
showpage
delay 40
r += d
if r > ymax/5 then r = ymax/5 : d *= -1 : delay 180
if r < 0 then r = 0 : d *= -1 : n += 1 : resetPlasma : delay 180
wend

sub
resetPlasma() 'all globals
plasmaR = rnd ^ 2 : plasmaG = rnd ^ 2 : plasmaB = rnd ^ 2 : plasmaN = 0
end

sub
setPlasma() 'all globals
plasmaN += 1
color rgb(127+127*sin(plasmaR*plasmaN),127+127*sin(plasmaG*plasmaN),127+127*sin(plasmaB*plasmaN))
end

Moire Happy Tmes ;-))

' Moire Flower Clock.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-19
' The Moire Flower Series Meets Analog clock 2017-04-27 [B+=MGA]
' Public Domain
randomize timer
const x0 = xmax/2
const y0 = ymax/2
const cr = y0/2
d = 1 : n = 12
while 1
cls
for i = 1 to n
cx = x0 + ymax/4*cos(i*2*pi/n-pi/2)
cy = y0 + ymax/4*sin(i*2*pi/n-pi/2)
cx2 = x0 + (ymax/4-r)*cos(i*2*pi/n-pi/2)
cy2 = y0 + (ymax/4-r)*sin(i*2*pi/n-pi/2)
for a = 0 to ymax/4 step 10
circle cx, cy, a color rgb(225, 100, 100)
circle cx2,cy2, a color rgb(128, 0, 40)
next
next
timehms timer, hour, mint, ssec
hours = hour+(mint/60)
if ( hours > 12 ) then hours -= 12
ha = hours *(2*PI)/12 : drawHand ha, cr * 0.5
ma = mint *(2*PI)/60 : drawHand ma, cr * 0.75
sa = ssec *(2*PI)/60 : drawHand sa, cr
circle x0, y0, 2, 1, 0
showpage
delay 40
r += d
if r > ymax/4 then r = ymax/5 : d *= -1
if r < 0 then r = 0 : d *= -1
wend

sub
drawHand(a, r)
dim h()
rr = 1/r * 900
h << x0 + r * cos(a-pi/2) : h << y0 + r * sin(a-pi/2)
h << x0 + rr * cos(a) : h << y0 + rr * sin(a)
h << x0 + 3*rr * cos(a+pi/2) : h << y0 + 3*rr * sin(a+pi/2)
h << x0 + rr * cos(a+pi) : h << y0 + rr * sin(a+pi)
h << x0 + r * cos(a-pi/2) : h << y0 + r * sin(a-pi/2)
color 15 : drawpoly h filled : color 0 : drawpoly h
end

Analog? I can remember taking almost a year to adjust our time piece to be accurate to with 30 seconds... Laugh as you might... But it's hard to adjust a sundial once the base has been cemented down...

LOL much easier to adjust, I agree!