void spiral(void);
void rollright(void);
void main()
{
int i1;
tg_openwin(600, 400);
tg_init();
tg_draw();
tg_pu();
tg_home();
tg_save();
tg_ml(300.0);
spiral();
tg_restore();
tg_save();
tg_ml(100.0);
spiral();
tg_restore();
tg_save();
tg_mr(100.0);
spiral();
tg_restore();
tg_save();
tg_mr(300.0);
spiral();
tg_restore();
tg_view();
tg_manual();
tg_pu();
tg_home();
tg_dn(90.0);
tg_bk(800.0);
rollright();
tg_rr(30.0);
rollright();
tg_rl(30.0);
for(i1 = 0; i1 < 2; i1++){
tg_rr(30.0); tg_refresh();
tg_rl(30.0); tg_refresh();
tg_rl(30.0); tg_refresh();
tg_rr(30.0); tg_refresh();
}
for(i1 = 0; i1 < 25; i1++){
tg_md(40.0); tg_refresh();
}
}
void spiral()
{
int c, i1;
tg_pu();
tg_fd(360.0);
tg_dn(90.0);
c = 1;
for(i1 = 0; i1 < 120; i1++){
tg_setpc(c);
tg_save();
tg_pd();
tg_fd(100.0);
tg_pu();
tg_restore();
tg_lt(3.0);
tg_md(6.0);
if(c == 7) c = 1; else c++;
}
}
void rollright()
{
int i1;
tg_view();
tg_manual();
for(i1 = 0; i1 < 36; i1++){
tg_rt(10.0);
tg_ml(800 * 3.14159 * 2 / 36);
tg_refresh();
}
}
|