示例#1
0
int main()
{
  int i, j;
  struct point p1;
  struct point p2;
  struct point p3;
 
  p1 = define_point(1, 2);
  p2 = define_point(5, 4);
  p3 = define_point(-2, 3);
    
  printf("p1 = ");
  put_point(p1);
  printf("\n");
 
  printf("p2 = ");
  put_point(p2);
  printf("\n");
 
  printf("p3 = ");
  put_point(p3);
  printf("\n");

  return 0; 
}
示例#2
0
int main()
{
  struct point p1,p2,p3;

  p1 = define_point(1,2);
  p2 = define_point(5,4);
  p3 = define_point(-2,3);

  printf("p1 = ");
  put_point(p1);
  printf("p2 = ");
  put_point(p2);
  printf("p3 = ");
  put_point(p3);

  return 0;  
}
示例#3
0
文件: orbit.c 项目: darius/tusdl
/* Plot a particle on the screen. */
static INLINE void
put_particle (int i, Pixel color)
{
  double x = particles[i].rx;
  double y = particles[i].ry;
  unsigned gx = (unsigned) (grid_width * (scale * x + 0.5)) % grid_width;
  unsigned gy = (unsigned) (grid_height * (0.5 - scale * y)) % grid_height;
  put_point (gx, gy, color, i);
}
示例#4
0
文件: hw2c.c 项目: asanciangco/CS133
void produce()
{
        bool ret;
        int next;
	
	#pragma omp critical
        ret = buffer_full()
		|| consumer_count + (w_index - r_index)%FIFO_SIZE > N;

        if(ret)
                return;

	#pragma omp critical
        next = (w_index + 1) % FIFO_SIZE;

        double x = (double) rand() / RAND_MAX;
        double y = (double) rand() / RAND_MAX;

        if(!put_point(x, y, next))
                return;

	#pragma omp critical
        w_index = next;
}
示例#5
0
文件: rm380z.c 项目: NULUSIOS/mame
void rm380z_state::init_graphic_chars()
{
	for (int c=0;c<0x3f;c++)
	{
		if (c&0x01) put_point(c,0,0,1);
		else                put_point(c,0,0,0);

		if (c&0x02) put_point(c,3,0,1);
		else                put_point(c,3,0,0);

		if (c&0x04) put_point(c,0,3,1);
		else                put_point(c,0,3,0);

		if (c&0x08) put_point(c,3,3,1);
		else                put_point(c,3,3,0);

		if (c&0x10) put_point(c,0,6,1);
		else                put_point(c,0,6,0);

		if (c&0x20) put_point(c,3,6,1);
		else                put_point(c,3,6,0);
	}
}