diff --git a/Makefile b/Makefile index 2dcf54e..406d1ee 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ road: bin/back bin/back levels/straight.txt bots/dumb bots/dumb2 bots/dumb3 bots/dumb4 mem: bin/back - valgrind --leak-check=full ./bin/back levels/test.txt bots/dumb bots/dumb2 bots/dumb3 bots/dumb4 + valgrind --leak-check=full ./bin/back levels/simple.txt bots/follow1 bots/follow2 bots/dumb4 bin/back: obj/main.o obj/display.o obj/base.o obj/collisions.o obj/music.o obj/cars.o obj/rooms.o obj/structure.o mkdir -p bin diff --git a/answer.txt b/answer.txt index 08cd8a9..153c33d 100644 --- a/answer.txt +++ b/answer.txt @@ -1 +1 @@ -0 100 +242 64 \ No newline at end of file diff --git a/lastActions.txt b/lastActions.txt index 4e395c4..52fc0ae 100644 --- a/lastActions.txt +++ b/lastActions.txt @@ -1,17 +1,8 @@ -150.590944 11.683077 -194.999333 -9.535755 -246.196400 8.324630 --147.165241 -169.202436 -247.618479 -14.399831 -14.099198 161.239629 -9.253936 206.557192 -22.808371 -181.895997 -247.722635 17.382579 --166.102866 13.162238 --178.044456 21.755561 -194.894848 94.175693 -227.159481 15.950874 --167.106667 9.399277 --186.773941 -18.340155 -53.315949 -185.413595 -251.568772 21.525103 +154.166507 9.734461 +205.806972 -14.226458 +173.674331 -36.266074 +238.827680 -9.528595 +20.538274 -173.689063 +240.210225 -2.541816 +153.741643 74.111175 +-73.886221 -125.850095 diff --git a/leaderboard.txt b/leaderboard.txt index 147d465..6ea68fb 100644 --- a/leaderboard.txt +++ b/leaderboard.txt @@ -2,10 +2,10 @@ name, elo ./bots/dumb 1347 ./bots/dumb2 1404 ./bots/dumb3 1355 -./bots/dumb4 1345 +./bots/dumb4 1135 ./bots/dumb5 540 ./bots/dumb6 562 -./bots/follow1 722 -./bots/follow2 801 -./bots/follow3 772 +./bots/follow1 810 +./bots/follow2 916 +./bots/follow3 822 ./bots/follow4 648 diff --git a/output.txt b/output.txt index f5641f9..da2a5e3 100644 --- a/output.txt +++ b/output.txt @@ -1,16 +1,11 @@ -4 -0 (2 0) (88.52 81.49) -1 (1 3) (72.05 50.53) -2 (1 3) (42.30 36.76) -3 (3 0) (28.47 26.93) -0 +3 +0 (2 0) (66.72 61.17) +1 (2 0) (45.95 34.36) +2 (0 0) (5.48 36.77) +2 -5 5 -..S14 -....0 -...35 -.E15. -..... +1 3 +S1E 100 200 5 0.90 0.80 0.20 0.00 0.20 diff --git a/src/main.c b/src/main.c index f42b86d..5730db1 100644 --- a/src/main.c +++ b/src/main.c @@ -254,7 +254,7 @@ int main(int argc, char** argv) { //B *= -1.0; updateWins(ranks); if(ONEATATIME == 1) { - if(0==winners[playerToMove]) { + if(remainingTurns != 0 && 0==winners[playerToMove]) { write_output("output.txt", stage, playerToMove); if(WAIT)usleep(1000000/10); player_turn(playerToMove, execs[playerToMove]); diff --git a/src/structure.c b/src/structure.c index 729a612..422ddf7 100644 --- a/src/structure.c +++ b/src/structure.c @@ -163,6 +163,9 @@ void updateLeaderBoard(char** execs, int* ranks) { int* diffs = get_elo_diffs(execs); bool* found = malloc(sizeof(bool)*nPlayers); + for(int p = 0; p < nPlayers; p++) { + found[p] = false; + } char* entry = malloc(sizeof(char)*64); int elo; int res = fscanf(ptr, "%s %d", entry, &elo); diff --git a/tempLeader.txt b/tempLeader.txt index 147d465..6ea68fb 100644 --- a/tempLeader.txt +++ b/tempLeader.txt @@ -2,10 +2,10 @@ name, elo ./bots/dumb 1347 ./bots/dumb2 1404 ./bots/dumb3 1355 -./bots/dumb4 1345 +./bots/dumb4 1135 ./bots/dumb5 540 ./bots/dumb6 562 -./bots/follow1 722 -./bots/follow2 801 -./bots/follow3 772 +./bots/follow1 810 +./bots/follow2 916 +./bots/follow3 822 ./bots/follow4 648