subroutine line (var delx, var dely): new qht,qwd,absdely; cpen; if dely > 0: if delx > dely: qwd = qqw; qht = dely*qqw/delx; else: qht = qqw; qwd = delx*qqw/dely; fi; call charbegin( 8(delx-1)+(dely-1),qwd,0,0,qht,0,0); x0=0; y0=0; x1=qwd*pixels; y1=qht*pixels; else: absdely=-dely; if delx > absdely: qwd = qqw; qht = absdely*qqw/delx; else: qht = qqw; qwd = delx*qqw/absdely; fi; call charbegin(64+8(delx-1)+(absdely-1),qwd,0,0,qht,0,0); x0=0; y0=qht*pixels; x1=qwd*pixels; y1=0; fi; qqs*pixels draw 0..1. subroutine larrow (var char, var delx, var dely): new rxa,rxb,rxc,rxd,rxe,rya,ryb,ryc,ryd,rye; new qht,qwd,absdely; cpen; if dely > 0: if delx > dely: qwd = qqw; qht = dely*qqw/delx; else: qht = qqw; qwd = delx*qqw/dely; fi; y0=0; else: absdely=-dely; if delx > absdely: qwd = qqw; qht = absdely*qqw/delx; else: qht = qqw; qwd = delx*qqw/absdely; fi; y0=qht*pixels; fi; call charbegin(char,qwd,0,0,qht,0,0); x0=0; rxa=arrowlen; rya=0; rxb=arrowlen; ryb=arrowht; rxc=arrowlen; ryc=-arrowht; rxd=.5rxa; ryd=.5ryb-arrowcurve; rxe=rxd; rye=-ryd; new rlen; rlen = sqrt(delx*delx + dely*dely); x1=(rxa*delx - rya*dely)/rlen; y1=(rxa*dely+rya*delx)/rlen + y0; %x2=rxb; y2=ryb; x2=(rxb*delx - ryb*dely)/rlen; y2=(rxb*dely+ryb*delx)/rlen + y0; %x3=rxc; y3=ryc; x3=(rxc*delx - ryc*dely)/rlen; y3=(rxc*dely+ryc*delx)/rlen + y0; %x4=rxd; y4=ryd; x4=(rxd*delx - ryd*dely)/rlen; y4=(rxd*dely+ryd*delx)/rlen + y0; %x5=rxe; y5=rye; x5=(rxe*delx - rye*dely)/rlen; y5=(rxe*dely+rye*delx)/rlen + y0; cpen; w0 ddraw 0..4..2,0..5..3. subroutine rarrow (var char, var delx, var dely): new rxa,rxb,rxc,rxd,rxe,rya,ryb,ryc,ryd,rye; new qht,qwd,absdely; cpen; if dely > 0: if delx > dely: qwd = qqw; qht = dely*qqw/delx; else: qht = qqw; qwd = delx*qqw/dely; fi; y0=qht*pixels; else: absdely=-dely; if delx > absdely: qwd = qqw; qht = absdely*qqw/delx; else: qht = qqw; qwd = delx*qqw/absdely; fi; y0=0; fi; call charbegin(char,qwd,0,0,qht,0,0); x0=qwd*pixels; rxa=-arrowlen; rya=0; rxb=rxa; ryb=arrowht; rxc=rxa; ryc=-arrowht; rxd=.5rxa; ryd=.5ryb-arrowcurve; rxe=rxd; rye=-ryd; new rlen; rlen = sqrt(delx*delx + dely*dely); %x1= rxa;y1=rya; %%%% replace the following by rotations x1=(rxa*delx - rya*dely)/rlen + x0; y1=(rxa*dely+rya*delx)/rlen + y0; %x2=rxb; y2=ryb; x2=(rxb*delx - ryb*dely)/rlen + x0; y2=(rxb*dely+ryb*delx)/rlen + y0; %x3=rxc; y3=ryc; x3=(rxc*delx - ryc*dely)/rlen + x0; y3=(rxc*dely+ryc*delx)/rlen + y0; %x4=rxd; y4=ryd; x4=(rxd*delx - ryd*dely)/rlen + x0; y4=(rxd*dely+ryd*delx)/rlen + y0; %x5=rxe; y5=rye; x5=(rxe*delx - rye*dely)/rlen + x0; y5=(rxe*dely+rye*delx)/rlen + y0; cpen; w0 ddraw 0..4..2,0..5..3. % character code rules, for % line(x,y): % 0 < x,y <= 6 : 8*(x-1) + (y-1) % % larrow(x,y): % 0 < x,y <= 4 : 8*(2x-1) + (2y-1) % y=0 : '33 % rarrow(x,y): % 0 < x,y < 3 : 8*(3x-1) + (3y-1) % 0 < x <= 4, y=3 : 8*(2x-1) + 6 % 0 < x < 4, y = 4 : 8*(2x) + 7 % x=3, 0 < y <=4 : 8*6 + (2y-1) % x = 4, 0 < y < 4 : 8*7 + 2y % y=0 : 55 % % for y < 0: value is 64 + value for (x, |y|) % % up arrow: '66 down arrow: '77 "Character '00"; call line(1,1). "Character '11"; call larrow('11,1,1). "Character '22"; call rarrow('22,1,1). "Character '01"; call line(1,2). "Character '13"; call larrow('13,1,2). "Character '25"; call rarrow('25,1,2). "Character '02"; call line(1,3). "Character '15"; call larrow('15,1,3). "Character '16"; call rarrow('16,1,3). "Character '03"; call line(1,4). "Character '17"; call larrow('17,1,4). "Character '27"; call rarrow('27,1,4). "Character '04"; call line(1,5). "Character '05"; call line(1,6). "Character '10"; call line(2,1). "Character '31"; call larrow('31,2,1). "Character '52"; call rarrow('52,2,1). "Character '12"; call line(2,3). "Character '35"; call larrow('35,2,3). "Character '36"; call rarrow('36,2,3). %"Character '13"; %call line(2,4). "Character '14"; call line(2,5). %"Character '15"; %call line(2,6). "Character '20"; call line(3,1). "Character '51"; call larrow('51,3,1). "Character '61"; call rarrow('61,3,1). "Character '21"; call line(3,2). "Character '53"; call larrow('53,3,2). "Character '63"; call rarrow('63,3,2). %"Character '22"; %call line(3,3). "Character '23"; call line(3,4). "Character '57"; call larrow('57,3,4). "Character '67"; call rarrow('67,3,4). "Character '24"; call line(3,5). %"Character '25"; %call line(3,6). "Character '30"; call line(4,1). "Character '71"; call larrow('71,4,1). "Character '72"; call rarrow('72,4,1). %"Character '31"; %call line(4,2). "Character '32"; call line(4,3). "Character '75"; call larrow('75,4,3). "Character '76"; call rarrow('76,4,3). %"Character '33"; %call line(4,4). "Character '34"; call line(4,5). %"Character '35"; %call line(4,6). "Character '40"; call line(5,1). "Character '41"; call line(5,2). "Character '42"; call line(5,3). "Character '43"; call line(5,4). %"Character '44"; %call line(5,5). "Character '45"; call line(5,6). "Character '50"; call line(6,1). %"Character '51"; %call line(6,2). %"Character '52"; %call line(6,3). %"Character '53"; %call line(6,4). "Character '54"; call line(6,5). %"Character '55"; %call line(6,6). "Character '100"; call line(1,-1). "Character '111"; call larrow('111,1,-1). "Character '122"; call rarrow('122,1,-1). "Character '101"; call line(1,-2). "Character '113"; call larrow('113,1,-2). "Character '125"; call rarrow('125,1,-2). "Character '102"; call line(1,-3). "Character '115"; call larrow('115,1,-3). "Character '116"; call rarrow('116,1,-3). "Character '103"; call line(1,-4). "Character '117"; call larrow('117,1,-4). "Character '127"; call rarrow('127,1,-4). "Character '104"; call line(1,-5). "Character '105"; call line(1,-6). "Character '110"; call line(2,-1). "Character '131"; call larrow('131,2,-1). "Character '152"; call rarrow('152,2,-1). "Character '112"; call line(2,-3). "Character '135"; call larrow('135,2,-3). "Character '136"; call rarrow('136,2,-3). %"Character '113"; %call line(2,-4). "Character '114"; call line(2,-5). %"Character '115"; %call line(2,-6). "Character '120"; call line(3,-1). "Character '151"; call larrow('151,3,-1). "Character '161"; call rarrow('161,3,-1). "Character '121"; call line(3,-2). "Character '153"; call larrow('153,3,-2). "Character '163"; call rarrow('163,3,-2). %"Character '122"; %call line(3,-3). "Character '123"; call line(3,-4). "Character '157"; call larrow('157,3,-4). "Character '167"; call rarrow('167,3,-4). "Character '124"; call line(3,-5). %"Character '125"; %call line(3,-6). "Character '130"; call line(4,-1). "Character '171"; call larrow('171,4,-1). "Character '172"; call rarrow('172,4,-1). %"Character '131"; %call line(4,-2). "Character '132"; call line(4,-3). "Character '175"; call larrow('175,4,-3). "Character '176"; call rarrow('176,4,-3). %"Character '133"; %call line(4,-4). "Character '134"; call line(4,-5). %"Character '135"; %call line(4,-6). "Character '140"; call line(5,-1). "Character '141"; call line(5,-2). "Character '142"; call line(5,-3). "Character '143"; call line(5,-4). %"Character '144"; %call line(5,-5). "Character '145"; call line(5,-6). "Character '150"; call line(6,-1). %"Character '151"; %call line(6,-2). %"Character '152"; %call line(6,-3). %"Character '153"; %call line(6,-4). "Character '154"; call line(6,-5). %"Character '155"; %call line(6,-6). %%%Horizontal arrows: "Character '33"; call larrow('33,1,0). "Character '55"; %right arrow call charbegin('55,qqw,0,0,qqw,0,0); x0=qqw*pixels; y0=0; x1=x0-arrowlen; y1=0; x2=x1; y2=arrowht; x3=x1; y3=-y2; x4=.5[x0,x1]; y4=.5y2-arrowcurve; x5=x4; y5=-y4; cpen; w0 ddraw 0..4..2,0..5..3. %%%vertical arrows "Character '66"; %up arrow call charbegin('66,qqw,0,0,qqw,0,0); x0=0; y0=qqw*pixels; y1=y0-arrowlen; x1=0; y2=y1; x2=arrowht; y3=y1; x3=-x2; y4=.5[y0,y1]; x4=.5x2-arrowcurve; y5=y4; x5=-x4; cpen; w0 ddraw 0..4..2,0..5..3. "Character '77"; %down arrow call charbegin('77,qqw,0,0,qqw,0,0); x0=0; y0=0; y1=arrowlen; x1=0; y2=y1; x2=arrowht; y3=y1; x3=-x2; y4=.5y1; x4=.5x2-arrowcurve; y5=y4; x5=-x4; cpen; w0 ddraw 0..4..2,0..5..3. end