diff --git a/again b/again index 936f849..bf25ee2 100755 Binary files a/again and b/again differ diff --git a/again.cmi b/again.cmi index de09b2c..5525283 100644 Binary files a/again.cmi and b/again.cmi differ diff --git a/again.cmx b/again.cmx index 1eaa111..635a8a8 100644 Binary files a/again.cmx and b/again.cmx differ diff --git a/again.ml b/again.ml index 6b77545..3a5bd18 100644 --- a/again.ml +++ b/again.ml @@ -425,6 +425,15 @@ let generate_gain_map (gd : game_data) = and cols = Array.length gd.laby.(0) in let bsize = gd.players.(gd.player_id).bomb_radius in let res = Array.make_matrix lines cols 0 in + + (* aim towards center by adding a bonus *) + for i = 0 to lines -1 do + for j = 0 to cols -1 do + res.(i).(j) <- res.(i).(j) + (min (min (i) (lines -1-i)) (min (j) (cols -1-j))) ; + done + done ; + + (* add potential score *) for l = 0 to lines -1 do for c = 0 to cols -1 do if (gd.laby.(l).(c) >= 3) || gd.laby.(l).(c) = 0 then begin @@ -1053,9 +1062,24 @@ let move_land (gd : game_data) (dgs : danger_map) (gn : int array array) = (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) let exists_crate (gd : game_data) (dgs : danger_map) = - Array.exists + let lines = Array.length gd.laby + and cols = Array.length gd.laby.(0) in + for i = 0 to lines -1 do + for j = 0 to cols -1 do + if dgs.explodedCrates.(i).(j) then + gd.laby.(i).(j) <- -2 ; + done + done ; + let res = Array.exists (fun line -> Array.exists (fun tile -> tile = 2) line) - gd.laby ;; + gd.laby in + for i = 0 to lines -1 do + for j = 0 to cols -1 do + if dgs.explodedCrates.(i).(j) then + gd.laby.(i).(j) <- 2 ; + done + done ; + res ;; (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) diff --git a/again.o b/again.o index d86d8fd..2c19092 100644 Binary files a/again.o and b/again.o differ diff --git a/entrees.txt b/entrees.txt index f70b6ff..44978b2 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,31 +1,31 @@ -211.3700000000007 -2 +223.51300000000185 +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1 1 1 1 1 1 -8 -5 8 4 211.4600000000004 -7 3 2 212.01000000000067 -6 9 4 213.0800000000004 -3 7 5 213.21000000000043 -10 3 2 214.44000000000068 -7 10 4 214.70000000000041 -11 10 5 214.93000000000043 -11 4 2 216.06000000000068 +7 +3 7 2 223.80000000000092 +7 14 3 224.63900000000177 +6 15 3 226.0970000000018 +10 13 3 226.3940000000016 +10 7 3 226.70000000000095 +5 16 3 227.55500000000183 +11 14 3 227.85200000000162 4 -1 10 0 2 0 5 1 3 -11 11 1 2 1 5 3 2 -11 5 2 2 3 2 3 1 -7 13 3 2 0 4 1 2 -0 +6 17 0 3 1 3 3 1 +10 15 1 3 1 3 0 1 +5 9 2 1 0 2 3 1 +11 5 3 1 1 3 2 1 +1 +1 10 2 diff --git a/iachallenge2024_bomberman_tkinter.py b/iachallenge2024_bomberman_tkinter.py index df3cb61..35b593f 100644 --- a/iachallenge2024_bomberman_tkinter.py +++ b/iachallenge2024_bomberman_tkinter.py @@ -352,7 +352,7 @@ def trouve_objet(i,j, liste): def casse(plateau, powerups, i,j): plateau[i][j]=PLATEAU_VIDE - if randrange(0,3)==0: + if randrange(0,BONUS_RANDMAX)==0: powerups.append([i,j, randrange(5)]) return @@ -464,7 +464,9 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo ip, jp = prochain(i,j,direction) ajoute_evenement(evenements, [evenement[0]+TEMPS_PROPAGATION, EVENEMENT_PROPAGATION, ip, jp, direction, longueurFlammes-1, indJoueur]) -NB_TROUS = 20 +NB_TROUS = 0 +BONUS_RANDMAX = 3 +# >0 TAILLE_TUILE = 40 HAUTEUR_JOUEUR = TAILLE_TUILE diff --git a/sortie.txt b/sortie.txt index 4a3b60a..57c1fa6 100644 --- a/sortie.txt +++ b/sortie.txt @@ -1 +1 @@ -0 0 \ No newline at end of file +2 1 \ No newline at end of file