Small 25 line program - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7) +---- Thread: Small 25 line program (/showthread.php?tid=1122) |
Small 25 line program - Gadgetjack - 11-15-2022 I found this on the "mmbasic" site and converted it to run on qb64. Screen 12 n = 255 r = (2 * pi) / 235 x = 0 v = 0 t = 0 sz = 200 s = 0 scrw = 640: scrh = 480 sw = scrw / sz: sh = scrh / sz offset = scrh / 4.5 Do Cls For i = 50 To n For j = 50 To n u = Sin(i + v) + Sin(r * i + x) v = Cos(i + v) + Cos(r * i + x) x = u + t q = scrw / 2 + u * offset a = scrh / 2 + v * offset PSet (q, a), _RGB32(Int(Rnd * 256), Int(Rnd * 256), Int(Rnd * 256)) Next j Next i t = t + .025 Loop A screen shot really does not look as good so run it and see. RE: Small 25 line program - bplus - 11-15-2022 What happens if we tweak numbers a bit and give pi a non zero value? Code: (Select All) Screen 12 EDIT: more dramatic color change RE: Small 25 line program - Gadgetjack - 11-15-2022 Ok , that is much better. Thanks. RE: Small 25 line program - bplus - 11-15-2022 Heh, I changed it a little more ;-)) RE: Small 25 line program - CharlieJV - 11-15-2022 (11-15-2022, 06:40 PM)Gadgetjack Wrote: I found this on the "mmbasic" site and converted it to run on qb64. Thanks for sharing that! I really like it. Ridiculously mesmerising. BAM version with an added "_DISPLAY" statement: RE: Small 25 line program - bplus - 11-15-2022 That does look good Charlie! RE: Small 25 line program - CharlieJV - 11-15-2022 (11-15-2022, 08:06 PM)bplus Wrote: That does look good Charlie! Man, I love these types of small BASIC programs that do cool stuff. I could watch that animation and/or fiddle with that program all day. RE: Small 25 line program - Gadgetjack - 11-15-2022 I am very impressed. In just a few minutes my little program got so much better. Thanks to all. RE: Small 25 line program - mnrvovrfc - 11-15-2022 (11-15-2022, 06:40 PM)Gadgetjack Wrote: I found this on the "mmbasic" site and converted it to run on qb64.Change "pi" to "_pi", use underscore in front of fake constant. This function should be covered by Steve in "keyword of the day" threads. Probably "mmbasic" has "pi" as predefined constant. RE: Small 25 line program - mnrvovrfc - 11-15-2022 I couldn't resist changing it for "guided" randomization: Code: (Select All) dim pr(1 to 10) as _byte |