Graphics

Mastermind.bas

SmallBASIC implementations: 
SmallBASIC syntax groups: 

'
'Mastermind v7.bas 2016-02-27 [B+=MGA] for SmallBASIC 0.12.2
'translated and modified from SdlBasic and forum input
'Thanks to Johnno for all his input, I used much
'v6 modified with new countingCattle function, more 3d look and color

Trees reflected.bas

SmallBASIC implementations: 
SmallBASIC syntax groups: 

'trees reflected v2.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-04-02
'overhaul wave maker section

const yshore=(ymax*.8)\1
const secwide=xmax
const sechigh=ymax-yshore
dim sect(secwide,sechigh)

const ang2rad=pi/180
color 15,0
for
i=0 to ymax
line 0,i,xmax,i,rgb(70,20,i/ymax*160)
next
stars=xmax*ymax*10^-4.35

Texting.bas

SmallBASIC implementations: 
SmallBASIC syntax groups: 

'texting.bas for SmallBASIC 0.12.2 [B+=MGA] 2016-02-21

cx=xmax/2
cy=ymax/2
dim cc(3)
cc(0)=9
cc(1)=14
cc(2)=12
cc(3)=rgb(0,128,0)
mess="SmallBASIC"
? mess
xd=txtw(mess)
yd=txth(mess)
side=xd+2*yd
dim dat(xd,yd)
for
y=0 to yd
for x=0 to xd

Planetary_system.bas

SmallBASIC implementations: 
SmallBASIC syntax groups: 

' a star and planetary system governed by newton's laws.
' when the escape velocity of a planet is exceded, it's trajectory turns red
' the range of x values on the screen is -130 to +130
' the range of y values on the screen is -100 to +100

WINDOW -640, -512,640, 512

func
gryb (yb, yp, ys, yt) = mp * (yp - yb) / rbp + ms * (ys - yb) / rbs + mt * (yt - yb) / rbt
func
grxb (xb, xp, xs, xt) = mp * (xp - xb) / rbp + ms * (xs - xb) / rbs + mt * (xt - xb) / rbt
func
gryp (yb, yp, ys, yt) = ms * (ys - yp) / rps + mb * (yb - yp) / rbp + mt * (yt - yp) / rpt

Pages

Subscribe to RSS - Graphics