home *** CD-ROM | disk | FTP | other *** search
- /* Lines */
- /* Jerkiness comes from use of C buffers */
- main()
- {
- local t;
- out = fopen("rawvdu:","w");
- mode(28); // 256 colours needed
- cursor(0);
- for(t=rnd()%24;t<32;t++)
- do_lines(t);
- fclose(out);
- cursor(1);
- }
-
- do_lines(t)
- {
- local x,y;
- for(x=0;x<1280;x+=4)
- {
- gcol(3,(t*(x>>2))%64);
- line(x,0,1280-x,1024);
- line(1280-x,0,x,1024);
- }
- for(y=1024;y>=0;y-=4)
- {
- gcol(3,(t*(y>>2))%64);
- line(0,y,1280,1024-y);
- line(0,1024-y,1280,y);
- }
- for(y=0;y<1024;y+=4)
- {
- gcol(3,(t+1)%64);
- line((5*y)/4,y,1280-(5*y)/4,y);
- line((5*y)/4,1024-y,1280-(5*y)/4,1024-y);
- }
- }
-
- vdu(s)
- {
- local i;
- for(i=0;i<sizeof(s);putc(s[i++],out));
- }
-
- mode(n)
- { vdu(""+22+n); }
-
- gcol(k,n)
- { vdu(""+18+k+n); }
-
- plot(k,x,y)
- { vdu(""+25+k+(x%256)+(x/256)+(y%256)+(y/256)); }
-
- move(x,y)
- { plot(4,x,y); }
-
- line(x1,y1,x2,y2)
- {
- move(x1,y1);
- plot(5,x2,y2);
- }
-
- cursor(n)
- {
- vdu(""+23+1+(n%256)+(n/256));
- }
-