BASIC8 Chastity Checker

I have a checkerboard function/program that I wrote in C and have used as the foundation of my BBM library. I translated it into BASIC8 without much effort because drawing rectangles to the screen is trivial.

REM BASIC8 port of Chastity Checker 
palette=list()
push(palette,rgba(0,0,0))
push(palette,rgba(255,255,255))
width=160,height=128
rectsize=8
def update()
index=0
y=0
while y<height
index1=index
x=0
while x<width
rectfill x,y,x+rectsize,y+rectsize,palette(index))
index=BXOR(index,1)
x=x+rectsize
wend
index=BXOR(index1,1)
y=y+rectsize
wend
enddef
update_with(driver())

Here is a screenshot of what it looks like when run inside BASIC8.

What is particularly great about this program is that it uses several elements such as while loops,x and y geometry coordinates,and a 2 element list of colors which can be changed to make all of the squares of black or white into any color combination of RGB.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s