fixed array not being initialized in ELO update function
This commit is contained in:
parent
de1a6b42c9
commit
bc48193ae3
2
Makefile
2
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
|
||||
|
|
|
@ -1 +1 @@
|
|||
0 100
|
||||
242 64
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
19
output.txt
19
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
|
||||
|
||||
|
|
|
@ -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]);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue