All pastes #399309 Raw Edit

Stuff

public c v1 · immutable
·published 2007-03-17 22:43 UTC
rendered paste body
void * fctLanceur(){    struct Balle *b;    while(1)    {        sigemptyset(&sigAct.sa_mask);        sigAct.sa_handler = handlerSigAlarme;        sigaction(SIGALRM,&sigAct,NULL);        b = (struct Balle *) malloc (sizeof(struct Balle));        do        {            b->ligne = rand()%13 + 1;            b->colonne = rand()%28 + 1;        }while(Terrain[b->ligne][b->colonne] == BALLE || Terrain[b->ligne][b->colonne] == ZONE);        do        {            b->couleur = rand()%10;        }while(b->couleur == BLANC || b->couleur == NOIR || b->couleur == GRIS);        b->dir = rand()%2;        pthread_create(&threadHandle, NULL, (void*(*)(void*))fctBalle,b);        alarm(4);        pause();    }}void handlerSigAlarme(int sig){}