Anything (at least theoretically) can be ported, to any other language, given the know-how.
(in one of the languages = good know-how, and in the other at least "reading" ability)
One such port is below, a Mandelbrot implementation from Rosetta Code (original in PureBasic)
converted to FreeBASIC:
Code: Select all
' Mandelbrot.bas -- recoded for FB -- 2017, MrSwiss
' original code from: Rosetta Code (PureBasic)
Const size = 500, half = 250, Wid = size * 1.5, Hei = size
ScreenRes(Wid, Hei, 32)
WindowTitle "Mandelbrot"
Dim As Single x_0, y_0, x_1, y_1, x, y, c
Dim As UInteger px, py, i
For px = 1 To Wid
x_0 = px / half - 2
For py = 1 To size
y_0 = py / half - 1
x = x_0
y = y_0
i = 0
While (c <= 2 AndAlso i < 100)
x_1 = (x * x) - (y * y) + x_0
y_1 = 2 * x * y + y_0
c = (x * x) + (y * y) * 0.5
x = x_1
y = y_1
i += 1
Wend
If i < 99 Then
PSet (px, py), RGB( (255/25)*i, (255/25)*i, (255/5)*i )
Else
PSet (px, py), &hFF000000
EndIf
c = 0
Next
Next
Sleep