#include "sharp95.h" #include "expdraw.h" #include #include #include /***************************************************************************/ /*Vector Graphic Drawing Routines */ /*Derived From Microsoft Quick C Turtle Demo Programs */ /*Developed/Integrated to Emulate Microsoft/GW-BASIC graphic DRAW function */ /* in X-Windows Motif by: */ /*Larry J. Hinson AWC/KCMO */ /***************************************************************************/ #define lineto(a,b) LineTo(a,b) #define moveto(a,b) MoveTo(a,b) struct turtle tc; char nu[17][50],az[26][50]; int dysw=0; int sizeconst=1; int OnScreen() { if (tc.xCur>0 && tc.xCur0 && tc.yCur',' && letter<=';') draw (nu[letter-43]); else if (letter==' '|| letter=='*') draw ("BR4"); else if (letter==13) draw(nu[59-43]); else if (letter=='<') draw ("BU7BR4G4F3BR5"); else if (letter=='>') draw ("BU6BR4F3G3BR5"); else draw(az[letter-65]); } } int draw(char *string) { /*DRAWING STRING INTERPRETER*/ char execstring[20]; int p=0,numericsw=0,i; /*SVGA_line_pattern((unsigned int) 0xffff);*/ for (i=0;i<=strlen(string);i++) { if (isalpha(string[i])) { if (numericsw) { execstring[p]='\0'; execdraw(execstring); numericsw=0; p=0; } execstring[p]=string[i]; p++; } if (isdigit(string[i])|| string[i]==',') { execstring[p]=string[i]; p++; numericsw=-1; } } if (numericsw) { execstring[p]='\0'; execdraw(execstring); numericsw=0; } return(0); } void execdraw(char *string) { /*B N U D L R E F G H Mx,y C S*/ char execstring[20],operation; int x=0,y=0,beginsw=0,noupdatesw=0,success=0,distance=0,i; /*clean string to execstring from ';' and ' '*/ int p=0; for (i=0;i 7) knots=speed-speed % 10 + 10; if (rightdigit > 2 && rightdigit<8) knots=speed - speed % 10 + 5; if (rightdigit < 3) knots=speed-speed%10; if (knots>=50) { fifties=knots/50; for (i=1;i<=fifties;i++) { /*DrawFlag*/ /* a. Draw left part of flag */ dirwork=dir+90; if (dirwork>360) dirwork-=360; TurnTo(dirwork); MoveP(12.0); /* b. Draw right part of flag */ dirwork=dir+90+150; if (dirwork>360) dirwork-=360; TurnTo(dirwork); nMoveP(13.8); /*Flag 1 complete*/ /*Now reposition for next flag */ PenDown(FALSE); MoveToP(x,y); TurnTo(dir); PenDown(TRUE); MoveP(25.0); Turn(180); MoveP(12*i); /* Change 10 to 12 */ knots-=50; } TurnTo(dir); } if (knots<50) { tens=(knots - knots % 10)/10; for(i=1;i<=tens;i++) { /* NR15D2 */ Turn(60); nMoveP(12.0); Turn(120); MoveP(5.0); /* Change 3 to 5 */ Turn(-180); } if ((knots % 10)==5) { if(speed<=7) MoveP(-5.0); /* Change 3 to 5 */ /* NR8 */ Turn(60); nMoveP(6.0); Turn(-60); } } }