'paint test
setautoback(1)

prints("esc to exit | leftmouse to write |right mouse to fill a close area")

xnew=0
ynew=0
while(inkey()=0)
	if bmouse()=1 then
		ink(rgb(255,255,255))
		xold=xnew:yold=ynew
		xnew=xmouse:ynew=ymouse
		if xold=0 then
			xold=xnew:yold=ynew
		end if
		line(xold,yold,xnew,ynew)
		'screenswap
		elseif bmouse()>1 then
		ink(rgb(rnd(255),rnd(255),rnd(255)))
		paint(xmouse,ymouse)
		'	screenswap
		xnew=0
		ynew=0
	end if
end while

