here is the start of a program I am making to draw using a variable bit code and hopefully encode an existing bitmap into this variable bit code, right now I just have the initialization stage and the first forward move phase‥ basically this drawing format has two phases that alternates between forward moves and turns in 45 degrees increments. it use a 1 for forward one and all the others are a string of 0's for a forward move of 2X the number of zeros plus the value of the next bit after a 1 bit, there is always a 1 bit (at least one) somewhere within the command as soon as you reach this one bit if you have been reading in a bunch of zero bits, you then look at the next bit and add that to your movement total. here is the program so far: mvt is the master vector table it coverts a heading from 0 to 7 into a relative movement in the x direction and in the y direction as well‥

dim mvt(7,1)

mvt(0,0)=1

mvt(0,1)=0

mvt(1,0)=1

mvt(1,1)=-1

mvt(2,0)=0

mvt(2,1)=-1

mvt(3,0)=-1

mvt(3,1)=-1

mvt(4,0)=-1

mvt(4,1)=0

mvt(5,0)=-1

mvt(5,1)=1

mvt(6,0)=0

mvt(6,1)=1

mvt(7,0)=1

mvt(7,1)=1

dx=screenX()

dy=screenY()

print dx,dy

input "initial position x ",px

input "initial position y ",py

input "initisl color red ",rc

input "initial color green ",gc

input "initial color blue ",bc

input "initial heading 0-7 ",h

graphics on

colorRGBA rc,gc,bc

point px,py

point px-1,py-1

point px-1,py

point px,py-1

point px,py+1

point px+1,py

point px+1,py+1

Input "forward move phase command ",fmc$

dst=0

fmcl = Len(fmc$)

libit$ = Left$(fmc$,1)

fb$=libit$

if libit$="1" then dst=1

do while libit$ = "0"

dst=dst+2

fmcl=fmcl-1

fmc$= Right$(fmc$,fmcl)

libit$=Left$(fmc$,1)

loop

if fb$="0" and right$ (fmc$,1) = "1" then dst = dst +1

for nan = 1 to dst

px=px+mvt(h,0)

py=py+mvt(h,1)

for blky=-1 to 1

for blkx=-1 to 1

point px+blkx,py+blky

next blkx

next blky

next nan

dim mvt(7,1)

mvt(0,0)=1

mvt(0,1)=0

mvt(1,0)=1

mvt(1,1)=-1

mvt(2,0)=0

mvt(2,1)=-1

mvt(3,0)=-1

mvt(3,1)=-1

mvt(4,0)=-1

mvt(4,1)=0

mvt(5,0)=-1

mvt(5,1)=1

mvt(6,0)=0

mvt(6,1)=1

mvt(7,0)=1

mvt(7,1)=1

dx=screenX()

dy=screenY()

print dx,dy

input "initial position x ",px

input "initial position y ",py

input "initisl color red ",rc

input "initial color green ",gc

input "initial color blue ",bc

input "initial heading 0-7 ",h

graphics on

colorRGBA rc,gc,bc

point px,py

point px-1,py-1

point px-1,py

point px,py-1

point px,py+1

point px+1,py

point px+1,py+1

Input "forward move phase command ",fmc$

dst=0

fmcl = Len(fmc$)

libit$ = Left$(fmc$,1)

fb$=libit$

if libit$="1" then dst=1

do while libit$ = "0"

dst=dst+2

fmcl=fmcl-1

fmc$= Right$(fmc$,fmcl)

libit$=Left$(fmc$,1)

loop

if fb$="0" and right$ (fmc$,1) = "1" then dst = dst +1

for nan = 1 to dst

px=px+mvt(h,0)

py=py+mvt(h,1)

for blky=-1 to 1

for blkx=-1 to 1

point px+blkx,py+blky

next blkx

next blky

next nan