Author Topic: Simple Patterns  (Read 3354 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Simple Patterns
« 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.  

Offline _vince

  • Seasoned Forum Regular
  • Posts: 422
    • View Profile
Re: Simple Patterns
« Reply #1 on: August 13, 2020, 01:25:51 am »
You can see entire scenes play out deep in those patterns, very hallucinogenic

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: Simple Patterns
« Reply #2 on: August 13, 2020, 06:33:24 am »
Careful, the government might decide they have to control that... pretty trippy.

Offline SierraKen

  • Forum Resident
  • Posts: 1454
    • View Profile
Re: Simple Patterns
« Reply #3 on: August 14, 2020, 12:23:42 am »
That's really cool Bplus, and no advanced math either. Good job!

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Simple Patterns
« Reply #4 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!
Logic is the beginning of wisdom.