JPQ Test 10
thhtd
ABCD
ABCD
ABCD
ttttttttth4444
- gg
- jyjyg4
- jnnnnnnnnnnnn
- uoooooooooooo
aaaaaaaaaaaaaa
bbbbbbbbbbbbb
ffffffffffffffffff
ccccccccccccccc
ddddddddddddddđ
eeeeeeeeeeeeeeeeeeeeee
fffffffffffffffffffffff
ggggggggggggggg
hhhhhhhhhhhhhh
99999999999999999999
100000000000101010
| a | |
| b | |
| c | d |
| e | |
| f | g |
| h | |
| i |
記事
コメント
おはよう
辛い物
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);
}
}
コメント
0件のコメント
サインインしてコメントを残してください。