5
Thought I would share this - but can this be compressed any more?
#include once "tinyptc_ext.bi"
const xres=640,yres=480,sf=512:Dim shared as integer size,q,w,a,x(sf),y(sf),s(sf),sb(xres*yres):size=8
for a=0 to sf-1:x(a)=(int(rnd(1)*xres)-1):y(a)=1+(int(rnd(1)*yres)-1):s(a)=1+(int(rnd(1)*8)):next:ptc_setdialog(0,"Fullscreen?",0,1)
If( ptc_open( "Starfield in less than 10 lines of code", XRES, YRES ) = 0 ) Then
End -1:End If
#define pp(x,y,argb) sb(y*XRES+x)=argb
While(GETASYNCKEYSTATE(VK_ESCAPE)<> -32767 and PTC_GETLEFTBUTTON=FALSE):for a=0 to sf-1: x(a)=x(a)-s(a):if x(a)<=0 then x(a)=(xres-1):y(a)=1+(int(rnd(1)*yres)-1)
for q=1 to size:for w=1 to size:if x(a)+q>0 and x(a)+q<xres-3 and (y(a)+w)>0 and (y(a)+w)<yres-2 then pp(x(a)+q,(y(a)+w),rgb(s(a)*16,s(a)*16,s(a)*16))
next:next:next:ptc_update @sb(0):erase sb:Wend:ptc_close():end
DrewPee