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
|
bin/back levels/straight.txt bots/dumb bots/dumb2 bots/dumb3 bots/dumb4
|
||||||
|
|
||||||
mem: bin/back
|
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
|
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
|
mkdir -p bin
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0 100
|
242 64
|
|
@ -1,17 +1,8 @@
|
||||||
150.590944 11.683077
|
154.166507 9.734461
|
||||||
194.999333 -9.535755
|
205.806972 -14.226458
|
||||||
246.196400 8.324630
|
173.674331 -36.266074
|
||||||
-147.165241 -169.202436
|
238.827680 -9.528595
|
||||||
247.618479 -14.399831
|
20.538274 -173.689063
|
||||||
14.099198 161.239629
|
240.210225 -2.541816
|
||||||
9.253936 206.557192
|
153.741643 74.111175
|
||||||
22.808371 -181.895997
|
-73.886221 -125.850095
|
||||||
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
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ name, elo
|
||||||
./bots/dumb 1347
|
./bots/dumb 1347
|
||||||
./bots/dumb2 1404
|
./bots/dumb2 1404
|
||||||
./bots/dumb3 1355
|
./bots/dumb3 1355
|
||||||
./bots/dumb4 1345
|
./bots/dumb4 1135
|
||||||
./bots/dumb5 540
|
./bots/dumb5 540
|
||||||
./bots/dumb6 562
|
./bots/dumb6 562
|
||||||
./bots/follow1 722
|
./bots/follow1 810
|
||||||
./bots/follow2 801
|
./bots/follow2 916
|
||||||
./bots/follow3 772
|
./bots/follow3 822
|
||||||
./bots/follow4 648
|
./bots/follow4 648
|
||||||
|
|
19
output.txt
19
output.txt
|
@ -1,16 +1,11 @@
|
||||||
4
|
3
|
||||||
0 (2 0) (88.52 81.49)
|
0 (2 0) (66.72 61.17)
|
||||||
1 (1 3) (72.05 50.53)
|
1 (2 0) (45.95 34.36)
|
||||||
2 (1 3) (42.30 36.76)
|
2 (0 0) (5.48 36.77)
|
||||||
3 (3 0) (28.47 26.93)
|
2
|
||||||
0
|
|
||||||
|
|
||||||
5 5
|
1 3
|
||||||
..S14
|
S1E
|
||||||
....0
|
|
||||||
...35
|
|
||||||
.E15.
|
|
||||||
.....
|
|
||||||
|
|
||||||
100 200 5 0.90 0.80 0.20 0.00 0.20
|
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;
|
//B *= -1.0;
|
||||||
updateWins(ranks);
|
updateWins(ranks);
|
||||||
if(ONEATATIME == 1) {
|
if(ONEATATIME == 1) {
|
||||||
if(0==winners[playerToMove]) {
|
if(remainingTurns != 0 && 0==winners[playerToMove]) {
|
||||||
write_output("output.txt", stage, playerToMove);
|
write_output("output.txt", stage, playerToMove);
|
||||||
if(WAIT)usleep(1000000/10);
|
if(WAIT)usleep(1000000/10);
|
||||||
player_turn(playerToMove, execs[playerToMove]);
|
player_turn(playerToMove, execs[playerToMove]);
|
||||||
|
|
|
@ -163,6 +163,9 @@ void updateLeaderBoard(char** execs, int* ranks) {
|
||||||
int* diffs = get_elo_diffs(execs);
|
int* diffs = get_elo_diffs(execs);
|
||||||
|
|
||||||
bool* found = malloc(sizeof(bool)*nPlayers);
|
bool* found = malloc(sizeof(bool)*nPlayers);
|
||||||
|
for(int p = 0; p < nPlayers; p++) {
|
||||||
|
found[p] = false;
|
||||||
|
}
|
||||||
char* entry = malloc(sizeof(char)*64);
|
char* entry = malloc(sizeof(char)*64);
|
||||||
int elo;
|
int elo;
|
||||||
int res = fscanf(ptr, "%s %d", entry, &elo);
|
int res = fscanf(ptr, "%s %d", entry, &elo);
|
||||||
|
|
|
@ -2,10 +2,10 @@ name, elo
|
||||||
./bots/dumb 1347
|
./bots/dumb 1347
|
||||||
./bots/dumb2 1404
|
./bots/dumb2 1404
|
||||||
./bots/dumb3 1355
|
./bots/dumb3 1355
|
||||||
./bots/dumb4 1345
|
./bots/dumb4 1135
|
||||||
./bots/dumb5 540
|
./bots/dumb5 540
|
||||||
./bots/dumb6 562
|
./bots/dumb6 562
|
||||||
./bots/follow1 722
|
./bots/follow1 810
|
||||||
./bots/follow2 801
|
./bots/follow2 916
|
||||||
./bots/follow3 772
|
./bots/follow3 822
|
||||||
./bots/follow4 648
|
./bots/follow4 648
|
||||||
|
|
Loading…
Reference in New Issue