Graphics
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
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"
?ripples.bas
Submitted by chrisws on Fri, 05/02/2008 - 21:13.Submitted by user: decomputer on 05/01/2008 - 18:35
'ripples.bas-run on palm only, will crash windows 98
' 21/08/2006
cls
pen on
while inkey$<>"."
randomize
circle pen(1), pen(2), fix(rnd*60)
sound (pen(1)*7), (pen(2)*0.5)
circle pen(1), pen(2), fix(rnd*60) color 15
sound (pen(1)*7), (pen(2)*0.5)
wend
pen off
end
Graphics
Submitted by chrisws on Mon, 12/03/2007 - 11:35.SmallBASIC’s graphics commands use integers (2D algebra commands use reals).
Colors
- Monochrome 0 = black, 15 = white
- 2bit (4 colors) 0 = black, 15 = white, 1-6, 8 = dark-gray, 7, 9-14 = light-gray
- 4bit (16 colors) 16 Standard VGA colors, 16 colors of gray (on PalmOS)
- 8bit (256 paletted colors) 16 Standard VGA colors. The remaining colors are ignored.
- 15bit (32K colors), 16bit (64K colors) and 24bit (1.7M colors) Color 0..15 is the standard VGA colors, full 24-bit RGB colors can be passed by using negative number.
Points
PAINT
Submitted by chrisws on Mon, 12/03/2007 - 11:35.Graphics command PAINT
If border-color is specified then PAINT will fill outwards until is meets the specified border-color – (fill-until, color!=point(x,y))
If the border-color is NOT specified then PAINT will fill the area with the same color as the pixel at x,y – (fill-while, color=point(x,y))
