diff --git a/Makefile b/Makefile index 058fb87..2dcf54e 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ testL: bin/back bin/back levels/test.txt bots/dumb bots/dumb2 bots/dumb3 bots/dumb4 bots/dumb5 bots/dumb6 test: bin/back - bin/back levels/long.txt bots/follow1 bots/follow2 bots/follow3 bots/follow4 + bin/back levels/test.txt bots/follow1 bots/follow2 bots/follow3 bots/dumb4 ez: bin/back bin/back levels/simple.txt bots/dumb bots/dumb2 bots/dumb3 bots/dumb4 diff --git a/answer.txt b/answer.txt index 6f104a1..08cd8a9 100644 --- a/answer.txt +++ b/answer.txt @@ -1 +1 @@ -154 100 +0 100 diff --git a/bots/follow.ml b/bots/follow.ml index 23c2b1c..f058b4d 100644 --- a/bots/follow.ml +++ b/bots/follow.ml @@ -103,6 +103,8 @@ let getDirs = function | '3' -> 6 | '4' -> 12 | '5' -> 9 + | '6' -> 5 + | '7' -> 10 | 'S' -> 15 | _ -> 0 in diff --git a/bots/follow.o b/bots/follow.o index 5b78fec..b38e1bb 100644 Binary files a/bots/follow.o and b/bots/follow.o differ diff --git a/bots/follow1 b/bots/follow1 index e728773..5e8f191 100755 Binary files a/bots/follow1 and b/bots/follow1 differ diff --git a/bots/follow2 b/bots/follow2 index e728773..5e8f191 100755 Binary files a/bots/follow2 and b/bots/follow2 differ diff --git a/bots/follow3 b/bots/follow3 index e728773..5e8f191 100755 Binary files a/bots/follow3 and b/bots/follow3 differ diff --git a/bots/follow4 b/bots/follow4 index e728773..5e8f191 100755 Binary files a/bots/follow4 and b/bots/follow4 differ diff --git a/lastActions.txt b/lastActions.txt index 5a16b9c..4e395c4 100644 --- a/lastActions.txt +++ b/lastActions.txt @@ -1,4 +1,17 @@ -141.540083 58.477089 -0.780967 252.062877 --182.018720 143.712962 --128.738125 83.680353 +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 diff --git a/leaderboard.txt b/leaderboard.txt index ba03a94..147d465 100644 --- a/leaderboard.txt +++ b/leaderboard.txt @@ -2,10 +2,10 @@ name, elo ./bots/dumb 1347 ./bots/dumb2 1404 ./bots/dumb3 1355 -./bots/dumb4 1466 +./bots/dumb4 1345 ./bots/dumb5 540 ./bots/dumb6 562 -./bots/follow1 657 -./bots/follow2 726 -./bots/follow3 652 -./bots/follow4 671 +./bots/follow1 722 +./bots/follow2 801 +./bots/follow3 772 +./bots/follow4 648 diff --git a/output.txt b/output.txt index 54a36d7..f5641f9 100644 --- a/output.txt +++ b/output.txt @@ -1,16 +1,16 @@ 4 -0 (0 1) (79.84 55.26) -1 (0 1) (63.60 77.08) -2 (0 1) (36.40 77.08) -3 (0 1) (20.16 55.26) -3 +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 -5 9 -31714.314 -S...035.6 -.E..25..0 -.6..37115 -.2175.... +5 5 +..S14 +....0 +...35 +.E15. +..... 100 200 5 0.90 0.80 0.20 0.00 0.20 diff --git a/src/main.c b/src/main.c index f64cd1c..f42b86d 100644 --- a/src/main.c +++ b/src/main.c @@ -25,6 +25,8 @@ bool matchDone = false; bool noise = true; +int playerToMove = 0; + FILE* save; void cameraActions(level* lvl, bool* halt, int* cx, int* cy, int* dezoom, int* sizeR) { @@ -175,6 +177,7 @@ int main(int argc, char** argv) { double elapsed = 0.0; bool halt = false; srand(time(NULL)); + playerToMove = rand()%(max(1,nPlayers)); if (SDL_Init(SDL_INIT_EVERYTHING) != 0) { printf("error initializing SDL: %s\n", SDL_GetError()); } @@ -250,12 +253,32 @@ int main(int argc, char** argv) { placeRectToRenderer(rend, 0, HEIGHT-50, 50, 50, 255, 32, 32, 192); //B *= -1.0; updateWins(ranks); - if(remainingTurns != 0)parse_all_players(stage, execs); - if(remainingTurns > 0) { - remainingTurns -= 1; - if(remainingTurns == 0) { - matchDone = true; - //halt = true; + if(ONEATATIME == 1) { + if(0==winners[playerToMove]) { + write_output("output.txt", stage, playerToMove); + if(WAIT)usleep(1000000/10); + player_turn(playerToMove, execs[playerToMove]); + } + playerToMove += 1; + while(playerToMove >= nPlayers) { + playerToMove -= nPlayers; + currentTurn += 1; + if(remainingTurns > 0) { + remainingTurns -= 1; + if(remainingTurns == 0) { + matchDone = true; + //halt = true; + } + } + } + } else { + if(remainingTurns != 0)parse_all_players(stage, execs); + if(remainingTurns > 0) { + remainingTurns -= 1; + if(remainingTurns == 0) { + matchDone = true; + //halt = true; + } } } elapsed = 0.0; diff --git a/src/music.c b/src/music.c index fbcb359..30d28e7 100644 --- a/src/music.c +++ b/src/music.c @@ -118,6 +118,7 @@ bool get_id(int* res) { } void play_sound(char* filename) { + return; pthread_mutex_lock(&lock); int id; if(get_id(&id)) { diff --git a/src/structure.c b/src/structure.c index 00cde70..729a612 100644 --- a/src/structure.c +++ b/src/structure.c @@ -20,6 +20,7 @@ const int PLAYER_R = 5; const int MAX_THETA_SPAWN = 80; // degrees const int BARRIERS = 1; +const int ONEATATIME = 1; const double BARRIER_WIDTH = 0.05; const double FRICTION = 0.90; diff --git a/src/structure.h b/src/structure.h index 2d44bfc..d959ad2 100644 --- a/src/structure.h +++ b/src/structure.h @@ -103,6 +103,7 @@ extern const double START_EDGE; extern const double RESTITUTION_WALL; extern const double RESTITUTION_PLAYER; extern const int BARRIERS; +extern const int ONEATATIME; extern const double BARRIER_WIDTH; extern const double FRICTION; diff --git a/tempLeader.txt b/tempLeader.txt index ba03a94..147d465 100644 --- a/tempLeader.txt +++ b/tempLeader.txt @@ -2,10 +2,10 @@ name, elo ./bots/dumb 1347 ./bots/dumb2 1404 ./bots/dumb3 1355 -./bots/dumb4 1466 +./bots/dumb4 1345 ./bots/dumb5 540 ./bots/dumb6 562 -./bots/follow1 657 -./bots/follow2 726 -./bots/follow3 652 -./bots/follow4 671 +./bots/follow1 722 +./bots/follow2 801 +./bots/follow3 772 +./bots/follow4 648