示例#1
0
文件: test.c 项目: yunfan/jyf-code
void draw_glider(world * w, unsigned int x, unsigned int y){
    world_set_cell(w, x, y+1, TRUE);
    world_set_cell(w, x+1, y+2 , TRUE);
    world_set_cell(w, x+2, y, TRUE);
    world_set_cell(w, x+2, y+1, TRUE);
    world_set_cell(w, x+2, y+2, TRUE);
}
示例#2
0
文件: gui.c 项目: FarK/CursoC
static gboolean mouse_btn_cb(GtkWidget *widget, GdkEventButton *e,
			     struct gui *g)
{
	world_set_cell(g->world, e->x / g->cell_size.x, e->y / g->cell_size.y,
		       true);
	gtk_widget_queue_draw(g->window);
}
示例#3
0
文件: test.c 项目: yunfan/jyf-code
void draw_glider_gun(world * w, unsigned int x, unsigned int y){
    world_set_cell(w, x+1, y+5, TRUE);
    world_set_cell(w, x+1, y+6, TRUE);
    world_set_cell(w, x+2, y+5, TRUE);
    world_set_cell(w, x+2, y+6, TRUE);
    world_set_cell(w, x+2, y+6, TRUE);

    world_set_cell(w, x+11, y+5, TRUE);
    world_set_cell(w, x+11, y+6, TRUE);
    world_set_cell(w, x+11, y+7, TRUE);

    world_set_cell(w, x+12, y+4, TRUE);
    world_set_cell(w, x+12, y+8, TRUE);

    world_set_cell(w, x+13, y+3, TRUE);
    world_set_cell(w, x+13, y+9, TRUE);

    world_set_cell(w, x+14, y+3, TRUE);
    world_set_cell(w, x+14, y+9, TRUE);

    world_set_cell(w, x+15, y+6, TRUE);

    world_set_cell(w, x+16, y+4, TRUE);
    world_set_cell(w, x+16, y+8, TRUE);

    world_set_cell(w, x+17, y+5, TRUE);
    world_set_cell(w, x+17, y+6, TRUE);
    world_set_cell(w, x+17, y+7, TRUE);

    world_set_cell(w, x+18, y+6, TRUE);

    world_set_cell(w, x+21, y+3, TRUE);
    world_set_cell(w, x+21, y+4, TRUE);
    world_set_cell(w, x+21, y+5, TRUE);

    world_set_cell(w, x+22, y+3, TRUE);
    world_set_cell(w, x+22, y+4, TRUE);
    world_set_cell(w, x+22, y+5, TRUE);

    world_set_cell(w, x+23, y+2, TRUE);
    world_set_cell(w, x+23, y+6, TRUE);

    world_set_cell(w, x+25, y+1, TRUE);
    world_set_cell(w, x+25, y+2, TRUE);
    world_set_cell(w, x+25, y+6, TRUE);
    world_set_cell(w, x+25, y+7, TRUE);

    world_set_cell(w, x+35, y+3, TRUE);
    world_set_cell(w, x+35, y+4, TRUE);

    world_set_cell(w, x+36, y+3, TRUE);
    world_set_cell(w, x+36, y+4, TRUE);

}