You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


Crop Circles
09-12-2017, 12:55 AM
Post: #1
 (Print Post)
Crop Circles
Code Snippet: [Select]
'crop circles 1.bas SmallBASIC 2015-09-19 MGA/B+
cx=xmax/2:cy=ymax/2:cr=cy-60:m=20:OK=1
pen on
rect 0,0,xmax,ymax,rgb(0,128,0) filled
while OK
   k=inkey
   if len(k)=1 and asc(k)=27 then OK=0
   if k="c" then rect 0,0,xmax,ymax,rgb(0,128,0) filled
   mx=pen(4):my=pen(5)
   dx=(mx-cx)/m:dy=(my-cy)/m:dr=cr/m
   for i=m to 0 step -1
      if i mod 2 then cc=rgb(0,160,0) else cc=rgb(0,128,0)
      x=cx+dx*(m-i):y=cy+dy*(m-i):r=dr*i
      circle x,y,r,1,cc filled
   next
   delay 200
wend
pen off


Attached File(s) Image(s)
   

B += _
Find all posts by this user
Like Post
The following 1 user Likes bplus's post:
Waltersmind (Admin)
09-12-2017, 12:57 AM (This post was last modified: 09-12-2017 12:59 AM by bplus.)
Post: #2
 (Print Post)
RE: Crop Circles
Coming soon...


Attached File(s) Image(s)
               

B += _
Find all posts by this user
Like Post
The following 2 users Like bplus's post:
KingAshish, Waltersmind (Admin)
09-14-2017, 11:37 AM
Post: #3
 (Print Post)
RE: Crop Circles
Where's the source code to the second set of graphics?

My goal is to bring joy, excitement, fun and education to all computer programming hobbyists, tinkerers, and amateurs. I also enjoy helping and working with those who aspire at becoming masters of their craft.
Find all posts by this user
Like Post
09-14-2017, 01:26 PM
Post: #4
 (Print Post)
RE: Crop Circles
Of course these are cherry picked!


Attached File(s) Image(s)
               

B += _
Find all posts by this user
Like Post
09-14-2017, 05:08 PM
Post: #5
 (Print Post)
RE: Crop Circles
Such variety from so little code:
Code Snippet: [Select]
' crop circles update.bas SmallBASIC 0.12.9 (B+=MGA) 2017-09-14
' from: crop circle #5.bas for SmallBASIC old FTLK 11.5 2015-11-01 MGA/B+
' 2017-09-14 mod for spacebar key SmallBASIC 0.12.9
definekey 32, cc
const x0 = xmax / 2 : const y0 = ymax/2
cc

sub cc
 color 15, rgb(0, 128, 0) : cls
 print "Crop Circles,   press spacebar for next field."
 r0 = Rand(1, 5) / 10 : r1 = Rand(1, 5) / 10: r2 = Rand(1, 5) / 10
 fc = Rand(1, 200) / 10 : st = Rand(10, 500) / 1000
 xol = 0 : yol = 0 : mol = 0
 for i = 0 to 120 step st
   a0 = (i / r0) * (2 * pi)
   a1 = ((i / r1) * (2 * pi)) * -1
   x1 = x0 + (sin(a0) * ((r0 - r1) * fc)) * 30
   y1 = y0 + (cos(a0) * ((r0 - r1) * fc)) * 30
   x2 = x1 + (sin(a1) * ((r2) * fc)) * 30
   y2 = y1 + (cos(a1) * ((r2) * fc)) * 30
   if mol = 0 then
     mol = 1: xol = x2: yol = y2
   else
     line xol, yol, x2, y2, rgb(0,194,0)
     xol = x2 : yol = y2
   end if
 next
 while inkey = 0 : delay 40: wend  
end

func Rand(low, high)
  Rand = rnd * (high - low) + low
end  


Attached File(s) Image(s)
               

B += _
Find all posts by this user
Like Post
The following 1 user Likes bplus's post:
johnno56
09-14-2017, 06:09 PM
Post: #6
 (Print Post)
RE: Crop Circles
So much variety from such little code!

Back in the mid 80's, running on a 4mhz box, it could take upward of about 2 minutes to draw just one pattern. Now, by just holding down space, several patterns are drawn per second... the mind boggles... at least 'mine' does... and that's not hard to do... lol

Great job!

J

May your journey be free of incident.

Live long and prosper.
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Input
QB64 Member Project - Overboard
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Sabotage
QB64 Member Project - Bowditch curve
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Dakapo
QB64 Member Project - Quarto
QB64 Member Project - Qubic
QB64 Member Project - Inside Moves
QB64 Member Project - Score 4
QB64 Member Project - Rubix's Magic
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Pivot version two
QB64 Member Project - Touche
QB64 Member Project - Kings Court
QB64 Member Project - Point Blank
QB64 Member Project - Dreamy Clock
QB64 Member Project - Line Thickness
QB64 Member Project - 9 Board
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Basic Dithering
QB64 Member Project - OpenGL Triangles
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Spiro Roses
QB64 Member Project - Rotating Background
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Color Rotating Text
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Othello
QB64 Member Project - Splatter
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Color Triangles
QB64 Member Project - Amazon
QB64 Member Project - Foursight
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Exit
QB64 Member Project - Swirl
QB64 Member Project - ARB Checkers
QB64 Member Project - Isolation
QB64 Member Project - Domain
QB64 Member Project - Connect Four
QB64 Member Project - Martin Fractals version four
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Kings Valley verion one
QB64 Member Project - Pivet version one
QB64 Member Project - Algeria Weather
QB64 Member Project - Blokus