Skip to content
Snippets Groups Projects
Commit 34d0af04 authored by belkhiritaha's avatar belkhiritaha
Browse files

transfert markov

parent c8591fe5
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
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
\ No newline at end of file
......@@ -185,6 +185,9 @@ void nextFire(listchainfire_t listFire){
else if ((pMedium<=probability)&&(probability<pStrong)){(listTemporary->fire).state=STRONG;}
else {(listTemporary->fire).state=SPREAD;}
printf("%d %d\n", probability, state);
printf("%d %d %d %d\n", pDead, pSparkle, pMedium, pStrong);
listTemporary=listTemporary->next;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
#include <time.h>
#include <stdio.h>
#define SIZEMARKOV 4
#define SIZEMARKOV 5
#define DEAD 0
#define SPARKLE 1
#define MEDIUM 2
......@@ -49,4 +49,5 @@ void readFapFromFile(char * filename);
void nextFire(listchainfire_t );
#endif
\ No newline at end of file
......@@ -8,7 +8,11 @@ int main(){
running = 1;
gameState = MENU;
readMapFromFile("map.txt");
readFapFromFile("markov.txt");
fireList = startFire(fireList,10,MAPSIZE);
travelFire(fireList);
nextFire(fireList);
nextFire(fireList);
nextFire(fireList);
mainLoop();
}
\ No newline at end of file
......@@ -167,8 +167,8 @@ void drawFire(){
srcRect.x = srcRect.w * (SDL_GetTicks()/200 % 8);
srcRect.y= 0;
while (cour != NULL){
rect.h = CELLSIZE;
rect.w = CELLSIZE;
rect.h = CELLSIZE * (cour->fire).state;
rect.w = CELLSIZE * (cour->fire).state;
rect.x = (cour->fire).x * CELLSIZE + (screenDimension.w - (MAPSIZE * CELLSIZE)) / 2;
rect.y = (cour->fire).y * CELLSIZE;
SDL_RenderCopy(renderer, fireTexture, &srcRect, &rect);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment