QB64.org Forum

Active Forums => Programs => Topic started by: bplus on August 12, 2020, 11:04:38 pm

Title: Simple Patterns
Post by: bplus on August 12, 2020, 11:04:38 pm
Code: QB64: [Select]
  1. _TITLE "Simple Patterns" '  B+ 2020-08-12
  2. ' rework Simple Pattern from SmallBASIC
  3. SCREEN _NEWIMAGE(1024, 700, 32)
  4. _DELAY .25
  5. s = 145: cd = 2
  6.     flip = 1 - flip
  7.     IF flip THEN
  8.         FOR k = .005 TO .995 STEP .005
  9.             GOSUB drawIt
  10.         NEXT
  11.     ELSE
  12.         FOR k = .995 TO .005 STEP -.005
  13.             GOSUB drawIt
  14.         NEXT
  15.     END IF
  16.     cd = cd * .987654321
  17.  
  18. drawIt:
  19. FOR i = 0 TO 1024
  20.     FOR j = 0 TO 700
  21.         x = i * s / 600: y = j * s / 600
  22.         c = x * x + y * y
  23.         d = c / cd
  24.         d = d - INT(d)
  25.         IF d < k THEN PSET (i, j)
  26.     NEXT
  27.  
Title: Re: Simple Patterns
Post by: _vince on August 13, 2020, 01:25:51 am
You can see entire scenes play out deep in those patterns, very hallucinogenic
Title: Re: Simple Patterns
Post by: OldMoses on August 13, 2020, 06:33:24 am
Careful, the government might decide they have to control that... pretty trippy.
Title: Re: Simple Patterns
Post by: SierraKen on August 14, 2020, 12:23:42 am
That's really cool Bplus, and no advanced math either. Good job!
Title: Re: Simple Patterns
Post by: johnno56 on August 14, 2020, 01:08:32 am
It didn't come in blue... so I changed it... 'Hallucinogenic'? Almost... More like a deer staring at the headlights of on oncoming truck... lol
Cool design. Well done!