예제 #1
0
파일: EXAMPLE.CPP 프로젝트: ananay/turboc
void display(){
	_setcursortype(_NOCURSOR);
	constream cout;
	for(int j=2; j<=23; j++){
		for(int k=2; k<=78; k++){
			gotoxy(k,j);
			if(selection == 1)cout<<setclr(random(15)+1);
			cout<<screen[j-2][k-2];
			cout<<setclr(WHITE);
			//cprintf();

		}
	}
	gotoxy(67,25);
	cout<<"[Score:"<<score<<"]";
}
예제 #2
0
void SystemWindow::outputToSystemMessages(string data)
{
     linesNr++;
     _Setbk bgColor;
     _setcursortype(_NORMALCURSOR);
     bgColor.color = RED;
     cout << bgColor;
     cout << setclr(WHITE);
   
   if (linesNr > 6)
   {
      gotoxy(2, 19);
      delline();
      gotoxy(1, 24);
      insline();     
      cout << "|";
      gotoxy(80, 24);
      cout << "|";
      gotoxy(2, 24);
   } 
   else 
   {
      gotoxy(2, 18 + linesNr);
   }
   cout << data;
}
예제 #3
0
/* >>>>>>>>>> EX14_1 <<<<<<<<<< */
void ex14_1 (void)
{ int n = 50, i, j;
  double   fpi = 3.14159 / 180., step, x, y;
  float  zlev;

  step = 360. / (n - 1);

  for (i = 0; i < n; i++)
  { xray[i] = (float) (i * step);
    yray[i] = (float) (i * step);
  }

  for (i = 0; i < n; i++)
  { for (j = 0; j < n; j++)
    { x = xray[i] * fpi;
      y = yray[j] * fpi;    
      zmat[i][j] = (float) (2 * sin (x) * sin (y));
    }
  }

  setpag ("da4p");
  disini ();
  complx ();
  pagera ();

  titlin ("Contour Plot", 1);
  titlin ("F(X,Y) = 2 * SIN(X) * SIN(Y)", 3);

  name   ("X-axis", "x");
  name   ("Y-axis", "y");

  intax  ();
  axspos (450, 2670);
  graf   (0.f, 360.f, 0.f, 90.f, 0.f, 360.f, 0.f, 90.f);

  height (30);
  for (i = 0; i < 9; i++)
  { zlev = (float) (-2. + i * 0.5);
    setclr ((i + 1) * 25);
    if (i == 4)
      labels ("none", "contur"); 
    else
      labels ("float", "contur");

    contur  (xray, n, yray, n, (float *) zmat, zlev);
  }

  height (50);
  color  ("fore");
  title  ();
  disfin ();
}
예제 #4
0
/* >>>>>>>>>> EXA_8  <<<<<<<<<< */
void exa_8 (void)
{ int   ixp[4], iyp[4], nl, nx, nx0 = 335, ny0 = 350, ny, i, j, ii, k, iclr;
  static int  ix[4] = {0, 300, 300, 0},
              iy[4] = {0, 0, 400, 400};
  static char *ctit = "Shading Patterns (AREAF)", cstr[3];

  disini ();
  setvlt ("small");
  pagera ();
  hwfont ();

  height (50);
  nl = nlmess (ctit);
  nx = (2970 - nl) / 2;
  messag (ctit, nx, 200);

  iclr = 0;
  for (i = 0; i < 3; i++)
  { ny = ny0 + i * 600;
    for (j = 0; j < 6; j++)
    { nx = nx0 + j * 400;
      ii = i * 6 + j;
      shdpat ((long) ii);
      sprintf (cstr, "%d", ii);

      iclr = iclr % 8;
      iclr++;
      setclr (iclr);

      for (k = 0; k < 4; k++)
      { ixp[k] = ix[k] + nx;
        iyp[k] = iy[k] + ny;
      }
      areaf  (ixp, iyp, 4);

      nl  = nlmess (cstr);
      nx += (300 - nl) / 2;
      messag (cstr, nx, ny + 460);
    }
  }
  disfin ();
}