#include "acllib.h"
#include "math.h"
#include“stdio.h”
void star(double s, int x, int y)
{
double SR1 = s*sin(72),
SR2 = s*sin(54),
CR1 = s*cos(72), CR2 =
s*cos(54);
int xA = x, yA =
y-s;
int xB = x+CR1, yB =
y-SR1;
int xC = x+SR2, yC =
y-CR2;
int xD = x-SR2, yD =
y-CR2;
int xE = x-CR1, yE =
y-SR1;
line(xE,yE,xB,yB);
line(xA,yA,xC,yC);
line(xC,yC,xE,yE);
line(xB,yB,xD,yD);
line(xD,yD,xA,yA);
}
int Setup()
{
int i;
initWindow("小星星",
DEFAULT, DEFAULT, 640, 480);
beginPaint();
setPenColor(BLACK);
setBrushColor(BLACK);
rectangle(0,0,640,480);
for(i=0; i<1000;
i++)
{
setPenColor(RGB(R, G, B));
star(8,X,Y);
}
endPaint();
return 0;
}
加载中,请稍候......