Page 31 - 2020학년도 MDP과제발표회 자료집 (통신과) (3)
P. 31
int i, ii;
int rnd_x;
int rnd_y;
int rnd_num;
for (ii=0;ii<iterations;ii++)
{
rnd_num = rand()%4+1;
for (i=0; i < rnd_num;i++)
{
rnd_x = rand()%8;
rnd_y = rand()%8;
setvoxel(rnd_x,rnd_y,7);
}
delay_us(10);
shift(AXIS_Z,-1);
}
}
// 랜덤으로 켜지기 꺼지기/
void effect_random_filler (int delay, int state)
{
int x,y,z;
int loop = 0;
if (state == 1)
{
fill(0x00);
} else
{
fill(0xff);
}
while (loop<511)
{
x = rand()%8;
y = rand()%8;
z = rand()%8;
if ((state == 0 && getvoxel(x,y,z) == 0x01) || (state == 1 && getvoxel(x,y,z)
- 30 -