Sorry to bump up the message...
Personnaly, i'm using an excellent basic language called Blitz3D and Blitzmax.
SuperStrict
Global wid:Int = 600, hig:Int = 600, depth:Int = 0, widH:Int = wid * 0.5, higH:Int = hig * 0.5
Global limit:Int = 8, resmax:Int = 8, res:Int = resmax, nAdd:Int = 0, nMax:Int = 1000
Global px:Double = - 208
Global py:Double = 0
Global pz:Int = MouseZ()
Global sc:Double = 0.003
Global mxs:Int
Global mys:Int
Global mzs:Int
Global col:Byte[10000 , 3]
Function palette()
Local r:Int , g:Int , b:Int , t:Int , c:Int = 5
SeedRnd MilliSecs()
Local ra:Int = Rnd( - c , c)
Local ga:Int = Rnd( - c , c)
Local ba:Int = Rnd( - c , c)
For t = 0 To 9999
col[t , 0] = r ; r:+ ra ; If r < 0 r = 0 ; ra = Rand(c) Else If r > 255 r = 255 ; ra = -Rand(c)
col[t, 1] = g ; g:+ga ; If g < 0 g = 0 ; ga = Rand(c) Else If g > 255 g = 255 ; ga = -Rand(c)
col[t , 2] = b ; b:+ ba ; If b < 0 b = 0 ; ba = Rand(c) Else If b > 255 b = 255 ; ba = -Rand(c)
Next
' Local file:TStream = WriteFile("palette.bin")
'
' For Local s:Int = 0 To 9999
'
' WriteByte file , col[s , 0]
' WriteByte file , col[s , 1]
' WriteByte file , col[s , 2]
'
' Next
'
' CloseFile file
End Function
Function mouse:Int()
Local ret:Int = False
If KeyHit(KEY_ESCAPE) End
If KeyHit(KEY_UP) nMax:+ 50 ; ret = True
If KeyHit(KEY_DOWN) If nMax > 300 Then nMax=nMax- 50 ; ret = True
If KeyHit(KEY_SPACE) palette() ; ret = True
mzs = (MouseZ() - pz) ; pz = MouseZ()
mxs = (MouseX() - widH)
mys = (MouseY() - higH)
MoveMouse widH , higH
If (mxs <> 0 Or mys <> 0 Or mzs <> 0)
px:+ mxs
py:+ mys
' If mzs > 0 sc = sc * 0.5 ; px:+(px - widH * sc) ; py:+(py - higH * sc)
' If mzs < 0 sc=sc* 2.0 ; px:- (px - widH * sc) * 0.5 ; py:- (py - higH * sc) * 0.5
If mzs > 0 Then
sc = sc * 0.5
px = px + (px - widH * sc)
py = py + (py - higH * sc)
EndIf
If mzs < 0 Then
sc = sc * 2.0
px = px - (px - widH * sc) * 0.5
py = py - (py - higH * sc) * 0.5
EndIf
ret = True
EndIf
If ret = True res = resmax; Return True
If res > 1 Then res = res - 1
Return False
End Function
Function mandelbrot:Int(ax:Double , ay:Double)
Local a1:Double = ax , b1:Double = ay , a2:Double , n:Int = 0
Repeat
' a2 = a1 * a1 - b1 * b1 + ax
' b1 = 2 * a1 * b1 + ay
' n = n + 1
' a1 = a2
a2 = a1 * a1 - b1 * b1 + ax
b1 = 2 * a1 * b1 + ay
n = n + 1
a1 = a2
Until (n > nMax) Or (a1 * a1 + b1 * b1) > limit
Return n
End Function
Function draw(cx:Double, cy:Double, scale:Double)
Local ax:Double, ay:Double, x:Int, y:Int, mMove:Int, n:Long
y = -higH
Repeat
ay = (cy + y) * scale
x = -widH
Repeat
ax = (cx + x) * scale
n = mandelbrot(ax , ay)
If n < nMax
SetColor col[n , 0] , col[n , 1] , col[n , 2]
DrawRect x + widH, y + higH, res, res
EndIf
x = x + res
Until x >= widH
If mMove = 0 Then mMove = mouse()
y = y + res
Until y >= higH
End Function
Incbin "iglass.ttf"
Graphics wid , hig , depth
MoveMouse widH , higH
Global HudFont:TImageFont = LoadImageFont("incbin::iglass.ttf", 11, SMOOTHFONT)
palette()
While Not KeyHit(KEY_ESCAPE)
Cls
draw(px, py, sc)
DrawCineStrip("Mandelbrot Explorer By Filax. [ px = " + px + " py = " + py + " Zoom = " + sc + " ]", "Space bar = Other colours / Esc = Quit / Mouse move = Scroll (Stop to show the final result) / Mouse wheel = Zoom")
Flip False
Wend
Function DrawCineStrip(txt1:String, txt2:String, height:Int = 30, red:Int = 20, green:Int = 15, blue:Int = 10, alpha:Float = 0.8)
SetBlend ALPHABLEND
SetColor red, green, blue
SetAlpha alpha
DrawRect 0, 0, GraphicsWidth(), height
DrawRect 0, GraphicsHeight() - height, GraphicsWidth(), height
SetBlend LIGHTBLEND
SetColor 255, 133, 74
SetAlpha 1
SetImageFont(HudFont)
DrawText txt1, 10, 0 + (height / 3)
DrawText txt2, 10, GraphicsHeight() - (Height - (height / 3))
End Function