diff --git a/again b/again index 060e69c..eb26a0e 100755 Binary files a/again and b/again differ diff --git a/again.cmi b/again.cmi index a5575d3..a872d18 100644 Binary files a/again.cmi and b/again.cmi differ diff --git a/again.cmx b/again.cmx index e691327..53b90ee 100644 Binary files a/again.cmx and b/again.cmx differ diff --git a/again.ml b/again.ml index 9939a10..9ecaa59 100644 --- a/again.ml +++ b/again.ml @@ -1105,7 +1105,7 @@ let seek_player (gd : game_data) (dgs : danger_map) = if logg then Printf.fprintf stderr "(%d, %d) --[%d]--> (%d, %d)\n" !cxi !cyi directn destx desty ; if destx = !cxi && desty = !cyi then begin if logg then Printf.fprintf stderr " Trapping\n" ; - print_ret "again.sav" (direction_after_trap gd dgs !cxi !cyi) 3 print_escape ; + print_ret "again_dash.sav" (direction_after_trap gd dgs !cxi !cyi) 3 print_escape ; cxi := !cxi + fst order.(directn) ; cyi := !cyi + snd order.(directn) ; has_trapped := true ; @@ -1113,7 +1113,7 @@ let seek_player (gd : game_data) (dgs : danger_map) = end else if !remaining_dash = 0. then begin if logg then Printf.fprintf stderr " Dashing\n" ; - print_ret "again.sav" directn 2 print_escape ; + print_ret "again_dash.sav" directn 2 print_escape ; remaining_dash := 3. ; cxi := !cxi + fst order.(directn) ; cyi := !cyi + snd order.(directn) ; @@ -1121,14 +1121,14 @@ let seek_player (gd : game_data) (dgs : danger_map) = end else if abs (destx - !cxi) + abs (desty - !cyi) <= gd.players.(pid).bomb_radius && gd.players.(pid).bomb_to_place > 0 then begin if logg then Printf.fprintf stderr " Bombing\n" ; - print_ret "again.sav" directn 1 print_escape ; + print_ret "again_dash.sav" directn 1 print_escape ; cxi := !cxi + fst order.(directn) ; cyi := !cyi + snd order.(directn) ; break := true ; end else begin if logg then Printf.fprintf stderr " Moving\n" ; - print_ret "again.sav" directn 0 print_escape ; + print_ret "again_dash.sav" directn 0 print_escape ; cxi := !cxi + fst order.(directn) ; cyi := !cyi + snd order.(directn) ; break := true ; @@ -1401,7 +1401,7 @@ print_dangers danger_data ;;*) (*Printf.fprintf stderr "\n" ;; print_dangers danger_data ;;*) -if read_queue "again.sav" then begin +if read_queue "again_dash.sav" then begin remaining_dash := !remaining_dash +. 1. ; if logg then Printf.fprintf stderr "[%d] reading...\n" game_map.player_id ; end @@ -1422,7 +1422,7 @@ else begin if logg then Printf.fprintf stderr "[player %d] %d %d (at time %f - with %d dash potential)\n" game_map.player_id !direction !action game_map.dt (int_of_float !remaining_dash); end else begin - ignore (read_queue "again.sav") + ignore (read_queue "again_dash.sav") end end;; (*Printf.printf "\n4 0" ;;*) diff --git a/again.o b/again.o index 3a36695..3111b42 100644 Binary files a/again.o and b/again.o differ diff --git a/again.sav b/again_dash.sav similarity index 100% rename from again.sav rename to again_dash.sav diff --git a/again_rem.sav b/again_rem.sav new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/again_rem.sav @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/again_traps.sav b/again_traps.sav new file mode 100644 index 0000000..e69de29 diff --git a/entrees.txt b/entrees.txt index 8264ef4..21df7e7 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,27 +1,26 @@ -122.20000000000016 +150.1250000000006 1 13 21 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 3 3 3 3 3 0 2 2 2 2 0 5 5 5 5 5 5 5 5 1 -1 3 1 3 1 2 1 2 1 2 1 2 1 0 1 5 1 4 1 5 1 -1 3 3 3 3 3 0 2 2 2 2 2 0 4 4 4 4 4 5 5 1 -1 3 1 3 1 2 1 2 1 2 1 2 1 0 1 5 1 4 1 4 1 -1 3 3 3 3 0 2 2 2 2 2 2 2 2 2 0 0 4 4 4 1 -1 3 1 3 1 0 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 -1 3 3 3 6 6 0 2 2 2 2 2 2 0 4 4 4 4 4 4 1 -1 6 1 0 1 0 1 2 1 2 1 2 1 2 1 4 1 4 1 4 1 -1 6 6 6 6 0 2 2 2 2 2 2 0 4 4 4 4 4 4 4 1 -1 6 1 6 1 0 1 2 1 2 1 2 1 0 1 4 1 4 1 4 1 -1 6 6 6 6 6 0 2 2 2 0 4 4 4 4 4 4 4 4 4 1 +1 3 3 3 3 3 3 3 3 0 2 2 2 0 5 5 5 5 5 5 1 +1 3 1 3 1 3 1 0 1 2 1 2 1 2 1 5 1 5 1 5 1 +1 3 3 3 3 3 3 3 3 0 2 2 2 2 2 5 5 5 5 4 1 +1 3 1 6 1 3 1 4 1 2 1 2 1 2 1 2 1 5 1 4 1 +1 3 3 6 6 4 4 4 4 4 2 2 2 2 2 4 2 0 0 4 1 +1 0 1 6 1 3 1 4 1 2 1 2 1 2 1 4 1 5 1 4 1 +1 3 6 6 6 6 6 4 2 2 2 2 2 0 0 4 4 4 4 4 1 +1 6 1 6 1 3 1 0 1 2 1 0 1 4 1 4 1 5 1 5 1 +1 6 6 6 6 6 6 6 6 6 0 6 4 4 4 4 4 4 5 5 1 +1 6 1 6 1 6 1 0 1 0 1 6 1 4 1 4 1 5 1 5 1 +1 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 4 5 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 -5 16 4 122.30000000000013 -1 -7 14 1 1 3 4 0 0 -6 -6 5 4 -1 6 3 -9 12 4 -10 13 2 -7 13 0 -2 13 4 +3 +1 8 2 151.25100000000052 +9 13 4 151.90400000000037 +7 14 4 154.82000000000042 +2 +4 7 1 3 3 2 1 0 +8 15 3 3 0 4 0 0 +2 +3 9 4 +8 11 2 diff --git a/graphing.c b/graphing.c index 6a7b621..e800f81 100644 --- a/graphing.c +++ b/graphing.c @@ -8,13 +8,13 @@ #include #include -int width = 800 ; -int height = 500 ; +int width = 900 ; +int height = 600 ; int offset = 25 ; int wside = 15 ; -int map_size = 64 ; +int map_size = 80 ; int min(int x, int y) { if(x < y) { @@ -345,13 +345,17 @@ void update_graph(SDL_Renderer* renderer, int** board, int current_time) { int y_size = 1+(top_y - bot_y)/(1+max_val) ; for(int t0 = 0; t0 < borned; t0++) { + int t = (t0 + max(0, current_time - map_size +1))%map_size ; + int xc = convex_pt(left_x, right_x, ((float)(t0))/((float)(borned))) ; + if(t%20==0) { + placeRectToRenderer(renderer, xc, offset+wside, x_size, height - 2*(offset+wside), 128, 128, 128, 128); + } for(int pl = 0; pl < 4; pl++) { - int t = (t0 + max(0, current_time - map_size +1))%map_size ; //int t = t0 ; - int xc = convex_pt(left_x, right_x, ((float)(t0))/((float)(borned))) ; int yc = convex_pt(bot_y, top_y, 1.0f - ((float)(max(0, board[t][pl])))/((float)(max_val+1))) ; //drawCircleToRenderer(renderer, xc, yc, 10) ; placeRectToRenderer(renderer, xc, yc-y_size+offset+wside, x_size, y_size, 255*(pl==0)+192*(pl==3), 255*(pl==2)+192*(pl==3), 255*(pl==1), 96) ; + } } int tmax = (borned-1 + max(0, current_time - map_size +1))%map_size ; @@ -391,7 +395,7 @@ int main(int argc, char** argv) { SDL_SetRenderDrawBlendMode(rend, SDL_BLENDMODE_BLEND); int** board = malloc(sizeof(int*)*map_size) ; - for(int k = 0; k < 128; k++) { + for(int k = 0; k < map_size; k++) { board[k] = malloc(sizeof(int)*4); for(int l = 0; l < 4; l++) { board[k][l] = (-1) ; @@ -420,7 +424,7 @@ int main(int argc, char** argv) { fprintf(stderr, "|||||||||||||||| QUIT ||||||||||||||||\n") ; - for(int k = 0; k < 128; k++) { + for(int k = 0; k < map_size; k++) { free(board[k]); } free(board); diff --git a/graphs b/graphs index 0eade77..6b9aeda 100755 Binary files a/graphs and b/graphs differ diff --git a/signal.txt b/signal.txt index d00491f..c227083 100644 --- a/signal.txt +++ b/signal.txt @@ -1 +1 @@ -1 +0 \ No newline at end of file diff --git a/sortie.txt b/sortie.txt index 69035af..4a3b60a 100644 --- a/sortie.txt +++ b/sortie.txt @@ -1 +1 @@ -3 0 \ No newline at end of file +0 0 \ No newline at end of file