plan9port

fork of plan9port with libvec, libstr and libsdb
Log | Files | Refs | README | LICENSE

move.c (480B)


      1 # include "e.h"
      2 # include "y.tab.h"
      3 
      4 void move(int dir, int amt, int p)
      5 {
      6 	double a;
      7 
      8 	yyval = p;
      9 	a = EM(amt/100.0, ps);
     10 	printf(".ds %d ", (int)yyval);
     11 	if (dir == FWD || dir == BACK)
     12 		printf("\\h'%s%gm'\\*(%d\n", (dir==BACK) ? "-" : "", a, p);
     13 	else if (dir == UP)
     14 		printf("\\v'-%gm'\\*(%d\\v'%gm'\n", a, p, a);
     15 	else if (dir == DOWN)
     16 		printf("\\v'%gm'\\*(%d\\v'-%gm'\n", a, p, a);
     17 	dprintf(".\tmove %d dir %d amt %g; h=%g b=%g\n",
     18 		p, dir, a, eht[yyval], ebase[yyval]);
     19 }