Open Forum > What's New

ScriptBasic - Raspberry Pi

(1/2) > >>

support:
I'm pleased  to announce a release of ScriptBasic for the Raspberry Pi. You can do a traditional install with a .deb file or as an AppImage

This version of the binaries do NOT work on the Raspberry Pi Zero.
(Requires ARM v7 or greater)

DEB Install:


--- Code: Bash ---sudo apt install ./scriptbasic-2.1-linux-armhf.deb
DEB Uninstall:


--- Code: Bash ---sudo apt remove scriptbasic-2.1-linux-armhf
To run a script use scriba <script nane> when using the DEB Install.

To use the AppImage version ScriptBasic, unzip the file in the /usr/local/bin (or a directory in the system path) and use sb <script_name> to run your scripts. To remove ScriptBasic, remove the sb file.

I have added scriptbasic-rpi-zero.deb as an attachment. This version will run on ALL versions of the Raspberry Pi where the scriptbasic-2.1-linux-armhf.deb and AppImage versiosn will only run on the ARM v7 versions of the boards. The same instructions apply just change the name of the .deb file.


ScriptBasic User and Developer Guides

Most of the ScriptBasic development activity is happening on the All BASIC Forum.

Language Features
[*] Tradional BASIC syntax
[*] Variant style variables (no definition or declaration  needed)
[*] Indexed, associative arrays (or combo of both) no practical limits
[*] Muilt-threaded - asynchronous / synchronous execution
[*] Unlimited seamless expansion via the extension API
[*] Embeddable API
[*] Footprint less than 800 KB
[*] Runs on everything with a single source tree (written in ANSI C)
[*] Application proxy web server that runs ScriptBasic code
[*] Cascading pre-processor support
[*] Debugger with single step execution, break points and more
[/list]

Extension Modules
[*] libcurl + SSL
[*] MySQL
[*] SQLite
[*] ODBC
[*] json
[*] XML
[*] regex
[*] CGI
[*] zlib
[*] SBT - thread support
[*] IUP - cross platform portable GUI
[*] SDL_gfx graphics primatives with alpha channel support
[*] BBC BASIC graphic library
[*] more ..
[/list]

Free - Open Source - MIT License

Raspberry Pi Downloads Attached

support:
I was able to get the BBC BASIC graphics extension module working on the Raspberry Pi.


--- Code: Script BASIC ---' UFO IMPORT bbc.bas BBC::OPEN "ScriptBasic BBC UFO - Raspberry PI"t1 = BBC::TIME()BBC::MODE 31BBC::ORIGIN 800, 600xs = 2ys = 2BBC::GCOL 0, 14BBC::OFFa = 700b = A * Ac = 600FOR x = 0 TO a STEP xs  s = x * x  p = SQR(b - s)  FOR i = -p TO p STEP 6 * ys    r = SQR(s + i * i) / a    q = (r - 1) * SIN(24 * r)    y = INT(i / 3 + q * c)    IF i = -p THEN      m = y      n = y    END IF    IF y > m THEN m = y    IF y < n THEN n = y    IF m = y OR n = y THEN      BBC::PLOT 69, NOT(x), y      BBC::PLOT 69, x, y    END IF  NEXTNEXTt2 = BBC::TIME()t3 = (t2 - t1) / 1000BBC::OFFBBC::VDUSTR "Time: " & FORMAT("%.4f", t3) & " seconds."WHILE BBC::KEYNAME(1) <> "-escape"WENDBBC::CLOSE 

support:
Here is the Fren example.


--- Code: Script BASIC ---' Fern IMPORT bbc.bas BBC::OPEN "ScriptBasic BBC fern - Raspbery Pi"t1 = BBC::TIME()BBC::MODE 31BBC::ORIGIN 200, 100BBC::OFFBBC::GCOL 0, 10x = 0y = 0FOR i = 1 TO 80000  r = BBC::RND(1)  IF r <= 0.1 THEN    a = 0    b = 0    c = 0    d = 0.16    e = 0    f = 0  END IF  IF r > 0.1 AND r <= 0.86 THEN    a = .85    b = .04    c = -.04    d = .85    e = 0    f = 1.6  END IF  IF r > 0.86 AND r <= 0.93 THEN    a = .2    b = -.26    c = .23    d = .22    e = 0    f = 1.6  END IF  IF r > 0.93 THEN    a = -.15    b = .28    c = .26    d = .24    e = 0    f = .44  END IF  newx = a * x + b * y + e  newy = c * x + d * y + f  x = newx  y = newy  BBC::MOVE 600 + 96 * x, 32 + 96 * y  BBC::DRAW 600 + 96 * x, 32 + 96 * yNEXT it2 = BBC::TIME()t3 = (t2-t1)/1000BBC::VDUSTR "Time: " & FORMAT("%.4f",t3) & " seconds"BBC::WAITKEYBBC::CLOSE 

support:
Finally the graph example. Hopefully other BBC BASIC fans will contribute examples as well.


--- Code: Script BASIC ---' Graph Demo IMPORT bbc.bas CONST SDLK_ESCAPE = 27 BBC::OPEN "ScriptBasic BBC graphdemo - Raspberry Pi"t1 = BBC::TIME()BBC::MODE 31BBC::ORIGIN 800, 600xlow = -10xhigh = 10ylow = -10yhigh = 10depth = 10xscale = 30yscale = 12c = -4000 FOR x = xlow TO xhigh  BBC::MOVE xscale * (x + ylow), yscale * (ylow - x) + c / (x * x + ylow * ylow + depth)  FOR y = ylow TO yhigh    BBC::DRAW xscale * (x + y), yscale * (y - x) + c / (x * x + y * y + depth)  NEXTNEXTFOR y = ylow TO yhigh  BBC::MOVE xscale * (xlow + y), yscale * (y - xlow) + c / (xlow * xlow + y * y + depth)  FOR x = xlow TO xhigh    BBC::DRAW xscale * (x + y), yscale * (y - x) + c / (x * x + y * y + depth)  NEXTNEXTt2 = BBC::TIME()t3 = (t2 - t1) / 1000BBC::OFFBBC::VDUSTR "Time: " & FORMAT("%.4f", t3) & " seconds."WHILE BBC::GETKEY(1) <> SDLK_ESCAPEWENDBBC::CLOSE 

support:
For those not into the retro BBC BASIC graphics primitives, I ported the SDL_gfx extension module to the Raspberry Pi.


--- Code: Script BASIC ---' ScriptBasic GFX - Alpha Circles IMPORT gfx.bas scrn = gfx::Window(640, 480, "ScriptBasic GFX - Alpha Circles - Raspberry Pi")' Random Value ArraysRANDOMIZE(gfx::Time())FOR i = 0 TO 512  rx[i] = RND() % 640  ry[i] = 60 + RND() % 480 - 80  rz[i] = RND() % 64  rr[i] = RND() AND  255  rg[i] = RND() AND  255  rb[i] = RND() AND  255  af = rx[i] / 640  ra[i] = INT(255 * af)NEXT ts = gfx::Time()FOR i = 0 TO 512  gfx::filledCircleRGBA scrn, rx[i], ry[i], rz[i], rr[i], rg[i], rb[i], ra[i]NEXTte = gfx::Time()gfx::stringColor scrn, 20, 15, "Time: " & FORMAT("%.4f",(te-ts)/1000) & " Seconds." & CHR(0), 0xffffffffgfx::UpdateWHILE gfx::KeyName(1) <> "+escape"WENDgfx::Close 

Navigation

[0] Message Index

[#] Next page

Go to full version