Voilà:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <dos.h>
#define LONGUEUR 50
typedef struct
{
int x;
int y;
int affiche;
} point;
point p2[LONGUEUR];
void afficheballedeb(void)
{
p2[0].x= 320;
p2[0].y= 240;
setfillstyle(SOLID_FILL, RED);
bar(p2[0].x, p2[0].y, p2[0].x+4, p2[0].y+4);
p2[1].x= 324;
p2[1].y= 240;
setfillstyle(SOLID_FILL, RED);
bar(p2[1].x, p2[1].y, p2[1].x+4, p2[1].y+4);
p2[2].x= 328;
p2[2].y= 240;
setfillstyle(SOLID_FILL, RED);
bar(p2[2].x, p2[2].y, p2[2].x+4, p2[2].y+4);
}
void changeTable(int indmax, int *indtete, int dx, int dy)
{
if( *indtete < indmax )
{
p2[*indtete].x+= dx;
p2[*indtete].y+= dy;
}
else
*indtete= 0;
}
void afficheballered(int indtete)
{
setfillstyle(SOLID_FILL, RED);
bar(p2[indtete].x, p2[indtete].y, p2[indtete].x+3, p2[indtete].y+3);
}
void afficheterrain(void)
{
rectangle(0, 0, 639, 479);
}
void graphicdriver(void)
{
int gdriver= DETECT, gmode, errorcode;
initgraph(&gdriver, &gmode, "");
errorcode= graphresult();
if( errorcode != grOk )
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
}
//-------------------------------------------------------------------//
//
// D.E.B.U.T SERPENT
//
//
//-------------------------------------------------------------------
int main(void)
{
int dx= 0, dy= 0, indtete= 0, indmax= 2;
int fin= 1;
graphicdriver();
afficheballedeb();
while ( fin )
{
changeTable(indmax, &indtete, dx, dy);
indtete= (indtete + 1) % LONGUEUR;
afficheballered(indtete);
afficheterrain();
delay(40);
switch(getch())
{
case 0:
continue;
case 72: // Haut
dx= 0;
dy= -1;
break;
case 80: // Bas
dx= 0;
dy= 1;
break;
case 75: // Gauche
dx= -1;
dy= 0;
break;
case 77: // Droite
dx= 1;
dy= 0;
break;
case 27: // Echap
fin= 0;
}
}
/* clean up */
closegraph();
return 0;
}
Core Breaker 
-------------------------------
Réponse au message :
-------------------------------
> je tiens juste à vous dire que je debute, et que ce prog tourne pas mais qu'il se compile completement avec un vieux borland
>
> voici mon prog ne rigolé pas et ne me dite pas d'utilisé les pointeur je sais pas encore faire je n'ai fais que de l'algorithmie, désolé....:-)
>
> #include <graphics.h>
> #include <stdlib.h>
> #include <stdio.h>
> #include <conio.h>
> #include <dos.h>
> #include <iostream.h>
>
> typedef struct{
> int x;
> int y;
> }point;
>
> point p2[50];
> void afficheballedeb()
> {
> p2[0].x =320;
> p2[0].y =240;
> setfillstyle(SOLID_FILL, RED);
> bar(p2[0].x,p2[0].y,p2[0].x+4,p2[0].y+4);
> p2[1].x =324;
> p2[1].y =240;
> setfillstyle(SOLID_FILL, RED);
> bar(p2[1].x,p2[1].y,p2[1].x+4,p2[1].y+4);
> p2[2].x =328;
> p2[2].y =240;
> setfillstyle(SOLID_FILL, RED);
> bar(p2[2].x,p2[2].y,p2[2].x+4,p2[2].y+4);
> }
>
> void changeTable(int indmax,int indtete,int dx, int dy)
> {
> if ( indtete<indmax )
> {
> p2[indtete].x=p2[indtete].x+dx;
> p2[indtete].y=p2[indtete].y+dy;
> }
> else
> {
> indtete=0;
> }
> }
>
>
> void afficheballered(int indtete)
> {
> setfillstyle(SOLID_FILL, RED);
> bar(p2[indtete].x,p2[indtete].y,p2[indtete].x+3,p2indtete].y+3);
> }
> void afficheterrain()
> {
> rectangle(0,0,639,479);
> }
> void graphicdriver()
> {
> int gdriver = DETECT, gmode, errorcode;
> initgraph(&gdriver, &gmode, "");
> errorcode = graphresult();
> if (errorcode != grOk)
> {
> printf("Graphics error: %s\n", grapherrormsg(errorcode));
> printf("Press any key to halt:");
> getch();
> exit(1);
> }
> }
>
> //-------------------------------------------------------------------//
> //
> // D.E.B.U.T SERPENT
> //
> //
> //-------------------------------------------------------------------
>
> int main(void)
> {
> int i,x,y,dx,dy,indtete,indmax;
> char car;
> graphicdriver();
> afficheballedeb();
> indtete=0;
> indmax=2;
> while ( car!=27 )
> {
> if (kbhit())
> {
> car = getch();
> if (car==72)
> {
> dx = -1;
> dy = 0;
> }
> if (car==80)
> {
> dx = 0;
> dy = -1;
> }
> if (car==75)
> {
> dx = 0;
> dy = 1;
> }
> if (car==77)
> {
> dx = 1;
> dy = 0;
> }
> changeTable(indmax,indtete,dx,dy);
> }
> indtete=indtete+1;
> afficheballered(indtete);
> afficheterrain();
> delay(40);
> }
> /* clean up */
> closegraph();
> return 0;
> }
>
>
>
>