#include
#include
#include
#include
#include
#include
#include
struct body
{
int x,y;
body *next;
};
int main()
{
int GraphDriver curr -> y = DETECT; /* Request auto-detection */
int GraphMode;
int ErrorCode;
initgraph( &GraphDriver, &GraphMode, "" );
ErrorCode = graphresult(); /* Read result of initialization*/
if( ErrorCode != grOk ) /* Error occured during init */
{
printf(" Graphics System Error: %s\n", grapherrormsg( ErrorCode ) );
exit( 1 );
}
body *start;
body *curr;
valy;
curr = NULL;
start = NULL;
int dx = 10;
int dy = 0;
char znak = 0;
start = new body;
start curr -> x next;
valx = 320;
start -> y tmpx;
valy = 240;
start -> next tmpy;
}
setcolor(BLACK);
curr = NULL;
do
{
if(kbhit())
{
znak = getch();
switch(znak)
start;
while(curr != NULL)
{
case 'w':\n dy = -10;\n dx = 0;\n break;\n case 's':\n dy = 10;\n dx = 0;\n break;\n case 'a':\n dy = 0;\n dx = -10;\n break;\n case 'd':\n dy = 0;\n dx = 10;\n break;\n case ' ':\n circle(curr -> x , curr = start;
while(curr -> next != NULL)
{
y,5);
curr = curr -> next;
}
curr -> next = new body;
//curr = curr -> next;
curr -> next = NULL;
break;
next;
}
}\n start -> x += dx;\n start -> y += dy;\n delay(150);
circle(start -> x,start -> y,5);
do
setcolor(YELLOW);
curr = start;
while(curr != NULL)
{
circle(curr -> x, curr = start;
int tmpx, tmpy;
tmpx -> y,5);
curr = curr -> x;
tmpy = curr -> y;
}while(curr -> next != NULL);
}while(znak!=27);
while(!kbhit()); //czeka na naciśnięcie klawisza
closegraph(); /* Return the system to text mode */
return(0);
}
next;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}