Skip to content
Snippets Groups Projects
Commit fd496115 authored by maberet's avatar maberet
Browse files

commit des modifications, recherche erreur

parent 7b697905
No related branches found
No related tags found
No related merge requests found
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
\ No newline at end of file
#include "fire.h" #include "fire.h"
#include "map.h"
int markov[SIZEMARKOV][SIZEMARKOV];
listchainfire_t initFire (void) listchainfire_t initFire (void)
{ {
...@@ -108,3 +111,22 @@ listchainfire_t freeListFire (listchainfire_t listFire){ ...@@ -108,3 +111,22 @@ listchainfire_t freeListFire (listchainfire_t listFire){
} }
return listFire; return listFire;
} }
listchainfire_t offFire (listchainfire_t listFire, int x ,int y ){
if (emptyListFire(listFire)){
return(listFire);
}
if(((listFire->fire).x==x)&&((listFire->fire).y==y)) {
(listFire->fire).state=0; // feu eteint
}
else{
listFire->next=offFire(listFire->next,x,y);
}
return listFire;
}
chainfire_t * listFireTest=NULL;
int numberFire=5;
listFireTest=startFire(listFireTest,numberFire,MAPSIZE);
\ No newline at end of file
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include <time.h> #include <time.h>
#include <stdio.h> #include <stdio.h>
#define SIZEMARKOV 4
typedef struct fire{ typedef struct fire{
int x; int x;
...@@ -33,5 +35,6 @@ booleen_t searchFire(listchainfire_t, int ,int); ...@@ -33,5 +35,6 @@ booleen_t searchFire(listchainfire_t, int ,int);
listchainfire_t deleteAheadFire(listchainfire_t); listchainfire_t deleteAheadFire(listchainfire_t);
listchainfire_t deleteFire (listchainfire_t, int ,int ); listchainfire_t deleteFire (listchainfire_t, int ,int );
listchainfire_t freeListFire (listchainfire_t ); listchainfire_t freeListFire (listchainfire_t );
listchainfire_t offFire (listchainfire_t, int,int );
#endif #endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment