Author Topic: Aurora Borealis comes to Ohio  (Read 4256 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Aurora Borealis comes to Ohio
« on: August 29, 2019, 09:18:05 pm »
https://www.cleveland19.com/2019/08/29/northern-lights-could-be-visible-parts-ohio-this-weekend/

No maybe Jackson Pollock,

No it's just Bplus and Curlie!

Code: QB64: [Select]
  1. _TITLE "Curlie Borealis" 'Quick trans B+ 2019-08-29
  2. 'Curlie borealis.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-04-23
  3. ' ;-) cool mods thanks to alpha
  4.  
  5. CONST xmax = 1200, ymax = 700
  6. DIM SHARED qb(15)
  7. qb(0) = &H33000000
  8. qb(1) = &H33000088
  9. qb(2) = &H33008800
  10. qb(3) = &H33008888
  11. qb(4) = &H3388000
  12. qb(5) = &H33880088
  13. qb(6) = &H33888800
  14. qb(7) = &H33CCCCCC
  15. qb(8) = &H33888888
  16. qb(9) = &H330000FF
  17. qb(10) = &H3300FF00
  18. qb(11) = &H3300FFFF
  19. qb(12) = &H33FF0000
  20. qb(13) = &H33FF00FF
  21. qb(14) = &H33FFFF00
  22. qb(15) = &H33FFFFFF
  23.  
  24. SCREEN _NEWIMAGE(1200, 700, 32)
  25. _SCREENMOVE 100, 20
  26. ff = 2.03: maxi = 25000
  27. COLOR 0, 0: CLS
  28. x = xmax / 2: y = ymax / 2
  29.     LINE (0, 0)-(xmax, ymax), _RGBA(40, 40, 40, 3), BF 'Fells trick
  30.     ff = ff + 100.431
  31.     IF RND < .4 THEN c = 0 ELSE c = INT(RND * 16) 'need more black oh ALPHA my friend!!!
  32.     FOR i = 0 TO maxi
  33.         f = f + ff
  34.         x = min(xmax, -1 * x + COS(f * i))
  35.         y = min(ymax, -1 * y + SIN(f * i))
  36.         LINE (x, y)-(x, y), qb(c)
  37.     NEXT
  38.     cc = cc + 1
  39.     _DISPLAY
  40.     _LIMIT 200 'oh man my fan is hot
  41.  
  42. FUNCTION min (a, b)
  43.     IF a < b THEN min = a ELSE min = b
  44.  
« Last Edit: August 29, 2019, 09:19:08 pm by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #1 on: August 29, 2019, 09:47:16 pm »
OK no Northern Lights, I shall compete with them and go for pretty!, this fixes the stuckedness I think...
Code: QB64: [Select]
  1. _TITLE "Curlie Borealis" 'Quick trans B+ 2019-08-29
  2. 'Curlie borealis.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-04-23
  3. ' ;-) cool mods thanks to alpha
  4.  
  5. CONST xmax = 1200, ymax = 700
  6. DIM SHARED qb(15)
  7. qb(0) = &HFF000000
  8. qb(1) = &HFF000088
  9. qb(2) = &HFF008800
  10. qb(3) = &HFF008888
  11. qb(4) = &HFF88000
  12. qb(5) = &HFF880088
  13. qb(6) = &HFF888800
  14. qb(7) = &HFFCCCCCC
  15. qb(8) = &HFF888888
  16. qb(9) = &HFF0000FF
  17. qb(10) = &HFF00FF00
  18. qb(11) = &HFF00FFFF
  19. qb(12) = &HFFFF0000
  20. qb(13) = &HFFFF00FF
  21. qb(14) = &HFFFFFF00
  22. qb(15) = &HFFFFFFFF
  23.  
  24. SCREEN _NEWIMAGE(1200, 700, 32)
  25. _SCREENMOVE 100, 20
  26. ff = 2.03: maxi = 25000
  27. COLOR &HFFFFFFFF, 0: CLS
  28. x = xmax / 2: y = ymax / 2
  29.     loopcnt = loopcnt + 1
  30.     LINE (0, 0)-(xmax, ymax), _RGBA(0, 0, 0, 3), BF 'Fells trick
  31.     ff = ff + 100.431
  32.     IF RND < .1 THEN c = 0 ELSE c = INT(RND * 16) 'need more black oh ALPHA my friend!!!
  33.     FOR i = 0 TO maxi
  34.         f = f + ff
  35.         x = min(xmax, -1 * x + COS(f * i))
  36.         y = min(ymax, -1 * y + SIN(f * i))
  37.         PSET (x, y), qb(c)
  38.     NEXT
  39.     cc = cc + 1
  40.     IF loopcnt MOD 1000 = 0 THEN
  41.         LOCATE 1, 1: PRINT SPACE$(10)
  42.         LOCATE 1, 1: PRINT loopcnt: _DELAY 1
  43.     END IF
  44.     IF loopcnt MOD 1800 = 0 THEN x = xmax / 2: y = ymax / 2: ff = 0: f = 0 'jiggle this sucker
  45.     _DISPLAY
  46.     _LIMIT 200 'oh man my fan is hot
  47.  
  48. FUNCTION min (a, b)
  49.     IF a < b THEN min = a ELSE min = b
  50.  
  51.  
  52.  

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #2 on: August 29, 2019, 10:08:19 pm »
Add some heat lightning and flash a color!

Code: QB64: [Select]
  1. _TITLE "Curlie Borealis" 'Quick trans B+ 2019-08-29
  2. 'Curlie borealis.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-04-23
  3. ' ;-) cool mods thanks to alpha
  4.  
  5. CONST xmax = 1200, ymax = 700
  6. DIM SHARED qb(15)
  7. qb(0) = &HFF000000
  8. qb(1) = &HFF000088
  9. qb(2) = &HFF008800
  10. qb(3) = &HFF008888
  11. qb(4) = &HFF88000
  12. qb(5) = &HFF880088
  13. qb(6) = &HFF888800
  14. qb(7) = &HFFCCCCCC
  15. qb(8) = &HFF888888
  16. qb(9) = &HFF0000FF
  17. qb(10) = &HFF00FF00
  18. qb(11) = &HFF00FFFF
  19. qb(12) = &HFFFF0000
  20. qb(13) = &HFFFF00FF
  21. qb(14) = &HFFFFFF00
  22. qb(15) = &HFFFFFFFF
  23.  
  24. SCREEN _NEWIMAGE(1200, 700, 32)
  25. _SCREENMOVE 100, 20
  26. ff = 2.03: maxi = 25000
  27. COLOR &HFFFFFFFF, 0: CLS
  28. x = xmax / 2: y = ymax / 2
  29.     loopcnt = loopcnt + 1
  30.     LINE (0, 0)-(xmax, ymax), _RGBA(0, 0, 0, 3), BF 'Fells trick
  31.     ff = ff + 100.431
  32.     IF RND < .1 THEN c = 0 ELSE c = INT(RND * 16) 'need more black oh ALPHA my friend!!!
  33.     FOR i = 0 TO maxi
  34.         f = f + ff
  35.         x = min(xmax, -1 * x + COS(f * i))
  36.         y = min(ymax, -1 * y + SIN(f * i))
  37.         PSET (x, y), qb(c)
  38.     NEXT
  39.     cc = cc + 1
  40.     IF loopcnt MOD 1000 = 0 THEN
  41.         LOCATE 1, 1: PRINT SPACE$(10)
  42.         LOCATE 1, 1: PRINT loopcnt: _DELAY 1
  43.     END IF
  44.     IF loopcnt MOD 1800 = 0 THEN x = xmax / 2: y = ymax / 2: ff = 0: f = 0 'jiggle this sucker
  45.     IF RND < .001 THEN PAINT (RND * xmax, RND * ymax), _RGBA(RND * 255, RND * 255, RND * 255, RND * 255)
  46.     _DISPLAY
  47.     _LIMIT 200 'oh man my fan is hot
  48.  
  49. FUNCTION min (a, b)
  50.     IF a < b THEN min = a ELSE min = b
  51.  
  52.  

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #3 on: September 02, 2019, 05:25:37 pm »
Hi Bplus
also in Kubuntu 14.04 it runs fine and is cool!
Qb64 runs good but it sometimes crashes itself.
Programming isn't difficult, only it's  consuming time and coffee

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #4 on: September 03, 2019, 09:30:08 am »
Thanks for feedback TempodiBasic :)

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #5 on: September 03, 2019, 10:30:02 am »
Cool program. Reminds me of the late 60's and early 70's....
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #6 on: September 03, 2019, 10:41:21 am »
Hey Johnno, yeah I think I got Curlie from PeterMaria (or Aurel? I got landscaping from Aurel mod that's for sure) maybe you remember him? Quite a few mods since then! :)

Offline Qwerkey

  • Forum Resident
  • Posts: 755
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #7 on: September 03, 2019, 03:45:36 pm »
Amazing what you can do with just 54 lines of code.  Rather lovely.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Aurora Borealis comes to Ohio
« Reply #8 on: September 03, 2019, 04:03:29 pm »
Hi Qwerkey,

Yeah, use to do daily shorties with guy named PeterMaria :)

Just think half those lines are QB(0 - 15) colors!