Wednesday, October 01, 2008

BASIC.
I've been an 'amateur' computer programmer since I was a teenager. I wrote a program this morning on the bus with "Palm Basic" on my Palm Treo 755p. It pretty much just approximates the functionality of an Etch-a-Scetch.
I decided to post here.

print "Welcome to Etch-a-755p"
print "PLEASE SELECT BRUSH:"
print " 'a' for inverted"
input " 'b' for draw: "ll$
print""
input "Need Instructions? (y/n) "i$
cls:print""
if i$="y" then print "up/dn: up/dn buttons ", ,"left/right: mail/home buttons","exit: phone button"
print"":input "'Enter' to start... "vv
cls:m=80:n=80
do until keydown(4)=1
a=a+keydown(2)
b=b+keydown(3)
c=c+keydown(6)
d=d+keydown(7)
x=n+d-c
y=m+b-a
if x > 159 then x= x -159
if x < 1 then x = x + 159
if y > 159 then y = y -159
if y < 1 then y = y + 159
if ll$="a" then invertline x,y,x+1,y+1 else drawline x,y,x+1,y+1
loop:cls
print""
print" 'menu' + 'R' to start again..."
print""
print" 'menu' + 'E' to edit code..."

No comments: