diff --git a/again b/again index b3b50a2..060e69c 100755 Binary files a/again and b/again differ diff --git a/again.cmi b/again.cmi index 1a42a67..a5575d3 100644 Binary files a/again.cmi and b/again.cmi differ diff --git a/again.cmx b/again.cmx index 964ef1b..e691327 100644 Binary files a/again.cmx and b/again.cmx differ diff --git a/again.ml b/again.ml index a8850a7..9939a10 100644 --- a/again.ml +++ b/again.ml @@ -11,7 +11,7 @@ TODO : Random.self_init () ;; let debug_all = false ;; -let logg = true ;; +let logg = false ;; let remaining_dash = ref 0. ;; @@ -693,7 +693,7 @@ let reverse_simulate_bomb (dgs : danger_map) (save : (int * int, float) Hashtbl. let is_dead (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) = (List.fold_left (* bombs *) (fun acc expl_time -> - acc || (t >= expl_time && t <= expl_time +. dt) || (t >= expl_time -. dt && t <= expl_time) + acc || (t >= expl_time && t <= expl_time +. dt)(**|| (t >= expl_time -. dt && t <= expl_time)*) ) false dgs.explosionTimes.(x).(y) @@ -708,7 +708,7 @@ let is_dead (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) = let is_dead_2 (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) = (List.fold_left (fun acc expl_time -> - acc || (t >= expl_time && t <= expl_time +. dt) || (t >= expl_time -. dt && t <= expl_time) + acc || (t >= expl_time && t <= expl_time +. dt)(* || (t >= expl_time -. dt && t <= expl_time)*) ) false dgs.explosionTimes.(x).(y) @@ -1384,7 +1384,7 @@ let gain_map = generate_gain_map game_map danger_data ;; get_rem_dash ("again"^(string_of_int game_map.player_id)^".sav") ;; -Printf.fprintf stderr "\n" ;; +(*Printf.fprintf stderr "\n" ;;*) if game_map.player_id = 4 then begin for l = 0 to Array.length gain_map -1 do for c = 0 to Array.length gain_map.(l) -1 do diff --git a/again.o b/again.o index d562841..3a36695 100644 Binary files a/again.o and b/again.o differ diff --git a/entrees.txt b/entrees.txt index 5563461..8264ef4 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,28 +1,27 @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1 1 1 1 1 1 1 1 1 1 1 1 1 1 -2 -11 14 2 89.5 -5 15 1 93.10000000000008 -2 -9 17 1 0 3 2 0 2 -3 15 2 1 2 1 1 0 -5 +1 +5 16 4 122.30000000000013 +1 +7 14 1 1 3 4 0 0 +6 +6 5 4 1 6 3 -10 5 0 -9 14 2 -8 15 0 -1 12 3 +9 12 4 +10 13 2 +7 13 0 +2 13 4 diff --git a/graphing.c b/graphing.c index 78c1da4..6a7b621 100644 --- a/graphing.c +++ b/graphing.c @@ -294,7 +294,7 @@ int get_data(char* filename, int** board, bool* ended) { *ended = true ; } - fprintf(stderr, "(%d, %d, %d, %d, %d)\n", cur_t, maze_w, maze_h, nbombs, nplayers); + //fprintf(stderr, "(%d, %d, %d, %d, %d)\n", cur_t, maze_w, maze_h, nbombs, nplayers); fclose(ptr) ; return cur_t ; @@ -360,6 +360,9 @@ void update_graph(SDL_Renderer* renderer, int** board, int current_time) { int yc = convex_pt(bot_y, top_y, 1.0f - ((float)(max(0, board[tmax][pl])))/((float)(max_val+1))) ; drawIntegerToRenderer(renderer, mval, 2, right_x+2-20*(-1+ln_b(10, mval)), yc+14-2*2, 14, 14, 255*(pl==0)+192*(pl==3), 255*(pl==2)+192*(pl==3), 255*(pl==1), 128) ; } + + drawIntegerToRenderer(renderer, current_time, 2, 375, 105/3+3, 75/3, 105/3, 0, 0, 0, SDL_ALPHA_OPAQUE); + updateRenderer(renderer) ; } diff --git a/graphs b/graphs index cb405bc..0eade77 100755 Binary files a/graphs and b/graphs differ diff --git a/iachallenge2024_bomberman_tkinter.py b/iachallenge2024_bomberman_tkinter.py index b683f46..314635f 100644 --- a/iachallenge2024_bomberman_tkinter.py +++ b/iachallenge2024_bomberman_tkinter.py @@ -383,7 +383,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo elif joueurs[indiceJoueur][J_PIEGESRESTANTS]>0 and action == A_PIEGE: joueur[J_PIEGESRESTANTS]-=1 pieges.append([i,j,indiceJoueur]) - print("||||| trap at", i, j, "|||||") + #print("||||| trap at", i, j, "|||||") i, j = joueur[J_LIGNE], joueur[J_COLONNE] indicePiege = trouve_objet(i,j, pieges) @@ -392,16 +392,16 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo piege = pieges[indicePiege] if piege[P_JOUEUR] != indiceJoueur: penalite = 3 - print(indiceJoueur, "|||||||| has triggered", piege[P_JOUEUR], "'s trap (at", i, j, ")||||||||") + print("[CONSOLE]", indiceJoueur, "has triggered", piege[P_JOUEUR], "'s trap (at", i, j, "), time =", temps, ")") pieges.pop(indicePiege) ip,jp = prochain(i,j,direction) if plateau[ip][jp]==PLATEAU_VIDE and trouve_objet(ip, jp, bombes)==None and penalite==0: - print(joueur[J_LIGNE], joueur[J_COLONNE], "--->", ip, jp) + #print(joueur[J_LIGNE], joueur[J_COLONNE], "--->", ip, jp) joueur[J_LIGNE]=ip joueur[J_COLONNE]=jp - else: - print("still") + #else: + #print("still") i, j = joueur[J_LIGNE], joueur[J_COLONNE] indicePowerup = trouve_objet(i,j,powerups) @@ -458,7 +458,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo indiceJoueur = trouve_objet(i,j,joueurs) while indiceJoueur != None: joueurs[indiceJoueur] = None - print("\n--------------------------------------------------------------------------------------------------------\n\nDEATH (at time =", evenement[0], "):", indiceJoueur, "\n\n--------------------------------------------------------------------------------------------------------\n") + print("[CONSOLE] DEATH (time =", evenement[0], "):", indiceJoueur, "\n") #assert(false) indiceJoueur = trouve_objet(i,j,joueurs) @@ -580,7 +580,7 @@ def simulation(strategies): joueurs = [] for i in range(len(strategies)): - joueur = [positionsInitiales[i][0], positionsInitiales[i][1], strategies[i], 0, 1, 1, 1, 1, 0, 0, 0] + joueur = [positionsInitiales[i][0], positionsInitiales[i][1], strategies[i], 0, 1, 1, 1, 0, 0, 0, 0] joueurs.append(joueur) ajoute_evenement(evenements, [0., EVENEMENT_TOUR_JOUEUR, i])