Here's a nice little fractal in Freebasic..
' Grinch Dragon By Shockwave.
' Thanks to Paul Bourke ( formula taken from his site ).
' Rbraz + Jim for PTC Lib.
'
'-------------------------------------------------------------------------------
OPTION STATIC
OPTION EXPLICIT
CONST XRES = 800:' SCREEN WIDTH
CONST YRES = 600:' SCREEN HEIGHT
#include "ptc.bi"
DIM SHARED AS UINTEGER BUFFER ( XRES * YRES ) :' SCREEN BUFFER
DIM SHARED AS DOUBLE XX,YY,ZZ,S1,S2,B,A,R,D13,D23,X1,Y1
DIM AS INTEGER L,XPL,YPL ,GADD,OX,OY
DIM AS UINTEGER COLOURS(YRES)
FOR L=0 TO YRES
COLOURS(L) = RGB(125+124*SIN(L/44),125+124*SIN(L/74),125+124*SIN(L/114))
NEXT
D13 = 1/3
D23 = 2/3
XX=RND(1)
YY=RND(1)
ZZ=RND(1)
A=0
B=0
S1 = 500
S2 = S1 * 750 / 1026
RANDOMIZE TIMER
B = 1 / (SQR(3))
R = 2.0
PTC_SETFLIP(1) :' SCREEN SYNC ON.
' OPEN THE SCREEN;
IF ( PTC_OPEN ( "GRINCH DRAGON.", XRES, YRES ) = 0 ) THEN
END -1
END IF
' MAIN LOOP;
WHILE(1)
GADD=GADD+2
OX=(160*SIN(GADD/200))+160
OY=(200*COS(GADD/177))+200
FOR L=1 TO 20000
A = RND(1)
IF A<=D13 THEN
X1 = (XX+YY*B)/R
Y1 = (B*XX-YY)/R
END IF
IF A>D13 AND A <=D23 THEN
X1 = (XX-B*YY)/R+1/R
Y1 = (-B *XX-YY)/R+B/R
END IF
IF A>=D23 THEN
X1 = ( XX+YY*B)/R+1
Y1 = -(B*XX-YY) / R
END IF
XX=X1
YY=Y1
IF L>10 THEN
XPL = OX+S1*XX/(1+ZZ/4)-200
YPL = OY + S2 * YY/(1+ZZ/4)
IF XPL>0 AND XPL<XRES AND YPL>0 AND YPL<YRES THEN
BUFFER(XPL+(YPL*XRES)) = COLOURS(YPL)
END IF
END IF
NEXT
PTC_UPDATE@BUFFER(0)
ERASE BUFFER
WEND
neat.. i was thinking about making one of those.. or a koch snowflake thingy or one of them smoking ship fractals.. but i decided on the buddha for my first submission.. might whip up something else later.. i still have like 2-3 days, right?
Nice picture but I was vaguely disappointed by the lack of sexual references in the code! ::) THATS an IFS shockwave :-)
n1 shockwave. Like the structure and the gradient colors of it.
Again very nice, dont know how you manage to make everything look like its got some old school flavour in it somewhere..... All Hail the old school king......
Nice one.
Old school king? :) I'm beaming but I don't deserve the accolade. Thanks for the comments :)
Yeah, it's only the 'old' part you deserve :p
Jim
Fucking right :) Karma up for that Jim!
I love it, but you already know that I like lots of color. And you are NOT OLD! I also like the old school feel!
:clap: