|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 1427 (0x593) Types: TextFile Notes: UNIX file Names: »spencil.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code └─⟦0a3c255ba⟧ UNIX Filesystem └─⟦this⟧ »graphics/spencil.c« └─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code └─⟦926b8033d⟧ UNIX Filesystem └─⟦this⟧ »u/demo/slide/spencil.c« └─⟦this⟧ »u/graphics/spencil.c«
#define MAXLINES 30 #define STARTX 508 #define STARTY 62 #define ENDX 700 #define ENDY 195 #define MAXX (ENDX-STARTX) #define MAXY (ENDY-STARTY) #define MAXCOUNT 2000 short pcount = 0; struct LINE { short lx1,ly1,lx2,ly2; }; struct LINE penlines[MAXLINES]; pencil() { struct LINE last,next; short ndx1,ndx2,ndy1,ndy2; short nl; /*clearw();*/ srand(14325); for(nl=0;nl<MAXLINES;nl++) penlines[nl].lx1 = penlines[nl].lx2 = penlines[nl].ly1 = penlines[nl].ly2 = 0; nl = 0; next.lx1 = next.lx2 = next.ly1 = next.ly2 = 0; while(pcount++ < MAXCOUNT) { if(nl == 0) { last = next; next.lx1 = irand(MAXX); next.lx2 = irand(MAXX); next.ly1 = irand(MAXY); next.ly2 = irand(MAXY); ndx1 = (next.lx1-last.lx1)/MAXLINES; ndx2 = (next.lx2-last.lx2)/MAXLINES; ndy1 = (next.ly1-last.ly1)/MAXLINES; ndy2 = (next.ly2-last.ly2)/MAXLINES; } fourl(&penlines[nl]); penlines[nl].lx1 = last.lx1+nl*ndx1; penlines[nl].lx2 = last.lx2+nl*ndx2; penlines[nl].ly1 = last.ly1+nl*ndy1; penlines[nl].ly2 = last.ly2+nl*ndy2; fourl(&penlines[nl]); nl = (++nl)%MAXLINES; } } fourl(l) struct LINE *l; { line(STARTX+l->lx1,STARTY+l->ly1,STARTX+l->lx2,STARTY+l->ly2); line(STARTX+l->lx1,ENDY-(l->ly1), STARTX+l->lx2, ENDY-(l->ly2)); line(ENDX-(l->lx1), STARTY+l->ly1, ENDX-(l->lx2), STARTY+l->ly2); line(ENDX-(l->lx1), ENDY-(l->ly1), ENDX-(l->lx2), ENDY-(l->ly2)); }