A B Ctm
A B Ctm
A B Ctm
A B C
-
FAQ
-
サービス全般
-
- CSS
- Admin
記事の設定
Font
Time news roman
| 記事 | セクション | カテゴリー | Cx | Cy | |
|
Zendesk |
|||||
| React |
#include <graphics.h>
#include <conio.h>
#include <math.h>
#define PI 3.14159265359
float d2r (int d){
//convert degree to radian
return d*PI/180.0;
}
int main(){
initwindow(640,480);
int xc = 320, yc = 240, r = 200;
int d = 270;
while(1){
for(int i = 0; i<=5;i++){
int x = xc + (int)(r * cos(d2r(d)));
int y = yc + (int)(r * sin(d2r(d)));
if (i == 0)
moveto(x,y);
else
lineto(x,y);
d+=144;
setcolor(i+1);
}
d+=5;
delay(100);
}
getch();
return 0;
}
Highlighted Text
snippet here
pre-formatted text here
subscript text here
記事
コメント
おはよう
辛い物
AB CD EF GH
Dev Test TRP
- A
- B
- あ
- い
- う
#include <stdio.h>
#include <graphics.h>
#include <conio.h>
#include <stdlib.h>
#include <math.h>
#include <dos.h>
struct point
{
int x, y, s, c, h;
};
void vediem(point, int);
void main()
{
point p[100];
int gdrv = DETECT, gmode, errorcode, mx, my, i;
initgraph(&gdrv, &gmode, "..\\BGI");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error : %s\n", grapherrormsg(errorcode));
printf("Press any key to halt ...");
getch();
exit(1);
}
mx = getmaxx();
my = getmaxy();
randomize();
for (i = 0; i < 100; i++)
{
p[i].x = random(mx);
p[i].y = random(my);
p[i].s = random(4);
p[i].c = random(16);
p[i].h = random(2);
}
while (!kbhit())
{
for (i = 0; i < 100; i++) vediem(p[i], 1);
delay(100);
for (i = 0; i < 100; i++) vediem(p[i], 0);
for (i = 0; i < 100; i++)
{
if (p[i].h)
{
p[i].s++;
if (p[i].s >= 3) p[i].h = 0;
}
else
{
p[i].s--;
if (p[i].s <= 3) p[i].h = 1;
}
}
}
closegraph();
}
void vediem(point p, int v)
{
int mau;
if (v) mau = p.c;
else mau = BLACK;
setcolor(mau);
switch (p.s)
{
case 0:
putpixel(p.x, p.y, mau);
break;
case 1:
line(p.x - 1, p.y, p.x + 1, p.y);
line(p.x, p.y - 1, p.x, p.y + 1);
break;
case 2:
line(p.x - 2, p.y, p.x + 2, p.y);
line(p.x, p.y - 2, p.x, p.y + 2);
break;
case 3:
line(p.x - 4, p.y, p.x + 4, p.y);
line(p.x, p.y - 4, p.x, p.y + 4);
rectangle(p.x - 1, p.y - 1, p.x + 1, p.y + 1);
}
}
Blvckcoral
コメント
0件のコメント
サインインしてコメントを残してください。