Welcome to Fractal Forums

Fractal Software => Programming => Topic started by: Cyclops on November 30, 2009, 05:48:03 PM




Title: Anyone still use Basic?
Post by: Cyclops on November 30, 2009, 05:48:03 PM
I had a bokk that had lots of fractal quilt programs written in basic and I remember having fun playing with those(after fixing bugs due to typos in the book!).
I cant get my head round C++ or owt like that, but is Basic still supported on modern OSs?


Title: Re: Anyone still use Basic?
Post by: stijnw on November 30, 2009, 07:05:46 PM
I had a bokk that had lots of fractal quilt programs written in basic and I remember having fun playing with those(after fixing bugs due to typos in the book!).
I cant get my head round C++ or owt like that, but is Basic still supported on modern OSs?

Basic is still available as language on a number of modern OS's: XBasic and FreeBasic (www.xbasic.org and www.freebasic.net).
If you don't want to port the existing code this could be an option.
I hope this helps...

Regards,
Stijn Wolters.


Title: Re: Anyone still use Basic?
Post by: Buddhi on November 30, 2009, 09:35:12 PM
I can propose Microsoft Visual Basic. I made lots of programs in this language (also some for engineering purpose) before I learned C++. Of course it is not as efficient as C++ but very easy to build some graphics interface and has all necessary functions to create some fractal renderer.


Title: Re: Anyone still use Basic?
Post by: David Makin on November 30, 2009, 09:39:58 PM
The ordinary programming language native to Ultra Fractal is not that different from BASIC (it's *very* similar to structured basic), if you don't bother with the new OOP classes etc. then you shouldn't have too much trouble picking it up. It has the benefit that most of the user interface stuff is done for you in a very configurable manner.


Title: Re: Anyone still use Basic?
Post by: Cyclops on December 01, 2009, 12:34:06 AM
Thanks guys! Now will any of these new Basics be compatible with the old style basic language from around 1990?(QBasic) I'd like to find that book and re~ type the programs,see them run on a decent speed computer


Title: Re: Anyone still use Basic?
Post by: stijnw on December 01, 2009, 11:22:10 AM
Thanks guys! Now will any of these new Basics be compatible with the old style basic language from around 1990?(QBasic) I'd like to find that book and re~ type the programs,see them run on a decent speed computer

I'm not sure about the QBasic compatibility of XBasic and FreeBasic, but on the FreeBasic site I found: "syntax similar to MS-QuickBASIC".
Anyway, it may not be as fast, but if you still have QBasic you can try to run it in an emulator like dosbox (or on real dos in a VM).

Regards,
Stijn Wolters.


Title: Re: Anyone still use Basic?
Post by: Nahee_Enterprises on January 03, 2010, 12:40:24 AM
I had a book that had lots of fractal quilt programs written
in basic and I remember having fun playing with those (after
fixing bugs due to typos in the book!).  I cant get my head
round C++ or owt like that, but is Basic still supported on
modern OSs?

Now will any of these new Basics be compatible with the
old style basic language from around 1990? (QBasic)  I'd
like to find that book and re~ type the programs, see
them run on a decent speed computer.

Not sure what OS and version you are currently using, but if it is a Windows environment, most likely getting the FREE Visual Basic.Net 2008 Express Edition from Microsoft will give you a place to start:
    http://www.microsoft.com/express/vb/Default.aspx (http://www.microsoft.com/express/vb/Default.aspx)

Of course you can still get the old QBASIC from Microsoft's website if you really feel nostalgic.  See the link at the bottom of this Wikipedia webpage:
    http://en.wikipedia.org/wiki/QBasic (http://en.wikipedia.org/wiki/QBasic)

I have both of the above, and working quite well, on three of my machines.


Title: Re: Anyone still use Basic?
Post by: filax on September 16, 2010, 11:23:25 AM
Hi all

Sorry to bump up the message... :) Personnaly, i'm using an excellent basic language called Blitz3D and Blitzmax.

http://www.blitzbasic.com

Here is a coding example of the mandelbrot set with blitzmax :

Executable :

http://www.blitz3dfr.com/freewares/fractales/mandelbrot.zip (http://www.blitz3dfr.com/freewares/fractales/mandelbrot.zip)

(http://www.blitz3dfr.com/freewares/fractales/mandelbrot.jpg)

Source code :
Code:
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


Title: Re: Anyone still use Basic?
Post by: axoneman on September 16, 2010, 02:58:37 PM
Hi everybody

You can find a full listing of Basic languages on this site:
 http://basic.mindteq.com/  (http://basic.mindteq.com/)

Hope it helps

François
Axone Man

axoneman.com


Title: Re: Anyone still use Basic?
Post by: ker2x on September 19, 2010, 11:26:51 PM
Sometimes i use PureBasic or BlitzMax.
Blitzmax is more complete (including an openCL module), but purebasic generate very nice, ready to patch, ready to recompile TASM file. So i can optimize my code directly in x86_64 Assembler :)





Title: Re: Anyone still use Basic?
Post by: Nahee_Enterprises on September 27, 2010, 01:29:42 PM
    Hi all
    Sorry to bump up the message... :)  Personnaly, i'm using an excellent
    basic language called Blitz3D and Blitzmax.  http://www.blitzbasic.com 

Greetings, and Welcome to this particular Forum !!!    :)

Thank you for the additional compiler and source code.  Always interested in the many variations that are available.