Welcome to SmallBASIC
Featured sample program: duty.bas
'#sec:Main
'' Time.bas
'' 18/01/2002
cls
c=0
label rep
k=inkey
if len(k)<>2 then goto rep
if c=0 then t1=ticks:cls:c=1:? t1:goto sue
if c=1 then t2=ticks:c=2:? t2:goto sue
if c=2 then t3=ticks:c=0:? t3:goto cal
label sue
k2=inkey:if len(k2)=2 then goto sue
goto rep
label cal
om=(t2-t1)/100
olf=(t3-t2)/100
tot=(t3-t1)/100
du=(om/tot)*100
?
? "On=",om
? "Off=",olf
? "Duty cycle=",du
goto rep
'
fractal_fern.bas
Submitted by kepu on Fri, 12/18/2009 - 12:02.
CLS
iii=0
RANDOMIZE TIMER
'x = 60
'y = 60
WHILE iii<100000
r = RND
IF (r <= .01) THEN
a = 0: b = 0: c = 0: d = .16: e = 0: f = 0
ELSEIF r > .01 AND r <= .86 THEN
a = .85: b = .04: c = -.04: d = .85: e = 0: f = 1.6
ELSEIF r > .86 AND r <= .93 THEN
a = .2: b = -.26: c = .23: d = .22: e = 0: f = 1.6
ELSE
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
PSET x*50+150, y*50, 2
SmallBASIC version 0.10.6 has been released
Submitted by chrisws on Tue, 12/15/2009 - 11:20.
SmallBASIC version 0.10.6 is now available for both Linux and Windows.
The changes include:
- Fix for Matrix inversion bug
- Fix for Scientific notation bug
- Updated editor tool-bar
- Implemented a new log window which can also be used as the output window when working with text only programs.
Please report any bugs you happen to find. Enjoy !
lakeshore_demo.bas
Submitted by kepu on Mon, 01/12/2009 - 08:27.
' A small water waving/flickering program
' For SB(fltk) 2 Jan 2009 , by Keijo Koskinen
' You can download lakeshore1.jpg from:
' http://users.csolve.net/~keiko/smallbasic/lakeshore1.jpg
' When lakeshore1.jpg appears to screen,
' ..right clic it and choose save as
' ..to your bas_home directory
' *** load image ***
'img= env("C:\sb_fltk_97\FLTK_0.9.7\Bas-Home")+"lakeshore1.jpg"
' or
img= env("Bas-Home")+"lakeshore1.jpg"
if (!exist(img)) then
?
sphere.bas
Submitted by kepu on Mon, 01/05/2009 - 07:09.
' A small 3D globe rotation program
' Converted to SB(fltk) 23,may 2006, from an old basic code
' by Keijo koskinen
' You can download sphere.gif from:
' http://users.csolve.net/~keiko/smallbasic/sphere.gif
' When sphere.gif appears to screen, ..right clic it and shoose save as ..to your bas_home directory
img= env("Bas_Home")+"sphere.gif"
if (!exist(img)) then
? "Sphere.gif does not exist "
? "then we are rolling this text"
?
conrec-sb-v01.bas
Submitted by Ted Clayton on Wed, 10/22/2008 - 10:32.
' CONREC - A Contouring Routine
'
' by Paul Bourke, Byte, June 1987
' Homepage http://ozviz.wasp.uwa.edu.au/~pbourke/papers/conrec/
' (See webpage for details of the method.)
' Adapted for SmallBasic-v0.9.5 by Ted Clayton
'
' CONREC avoids the advanced math & heavy computation
' of more-formal contour-generation methods, by using
' a series of geometric tests within a local 'box'
' around & above each point in a data-grid.
' Each contour-segment is generated independently
' of other segments while scanning the grid
' raster-fashion.




Recent comments
2 days 7 hours ago
1 week 2 days ago
1 week 4 days ago
2 weeks 2 hours ago
3 weeks 2 days ago
3 weeks 3 days ago
6 weeks 6 days ago
6 weeks 6 days ago
9 weeks 6 days ago
9 weeks 6 days ago