diff --git a/again b/again index a7aff6e..35efbbb 100755 Binary files a/again and b/again differ diff --git a/again.cmi b/again.cmi index 506e89b..e66a89e 100644 Binary files a/again.cmi and b/again.cmi differ diff --git a/again.cmx b/again.cmx index f9261dc..7621beb 100644 Binary files a/again.cmx and b/again.cmx differ diff --git a/again.ml b/again.ml index 3257499..da62642 100644 --- a/again.ml +++ b/again.ml @@ -1078,7 +1078,7 @@ let seek_player (gd : game_data) (dgs : danger_map) = let directn = path_seek gd dgs (gd.dt -. interval *. !remaining_dash) !cxi !cyi destx desty (player_range + int_of_float !remaining_dash) foundpath in if !foundpath then begin found := true ; - if logg then Printf.fprintf stderr "Found target (%d)\n" pl ; + if logg then Printf.fprintf stderr "Found target (%d) [%d]\n" pl (int_of_float !remaining_dash) ; 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" ; @@ -1122,6 +1122,7 @@ let seek_player (gd : game_data) (dgs : danger_map) = remaining_dash := max 0. (!remaining_dash -. 1.) done ; if logg then Printf.fprintf stderr "Success!\n" ; + remaining_dash := !remaining_dash +. 1. ; true with | ReturnBool b -> b ;; @@ -1378,7 +1379,7 @@ print_dangers danger_data ;;*) print_dangers danger_data ;;*) if read_queue "again.sav" then begin - () + remaining_dash := !remaining_dash +. 1. end else begin let direction = ref 4 in diff --git a/again.o b/again.o index cd2254d..b959d36 100644 Binary files a/again.o and b/again.o differ diff --git a/entrees.txt b/entrees.txt index 48ac767..d5e6de0 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,21 +1,22 @@ -69.28 -1 +107.0 +0 13 21 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 1 -1 0 1 0 1 0 1 0 1 2 1 0 1 0 1 0 1 0 1 0 1 -1 0 0 0 0 0 0 0 2 0 2 0 0 0 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a/iachallenge2024_bomberman_tkinter.py +++ b/iachallenge2024_bomberman_tkinter.py @@ -384,11 +384,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo joueur[J_PIEGESRESTANTS]-=1 pieges.append([i,j,indiceJoueur]) print("||||| trap at", i, j, "|||||") - ip,jp = prochain(i,j,direction) - if plateau[ip][jp]==PLATEAU_VIDE and trouve_objet(ip, jp, bombes)==None: - joueur[J_LIGNE]=ip - joueur[J_COLONNE]=jp - + i, j = joueur[J_LIGNE], joueur[J_COLONNE] indicePiege = trouve_objet(i,j, pieges) penalite = 0 @@ -396,8 +392,18 @@ 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, ")||||||||") 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) + joueur[J_LIGNE]=ip + joueur[J_COLONNE]=jp + else: + print("still") + i, j = joueur[J_LIGNE], joueur[J_COLONNE] indicePowerup = trouve_objet(i,j,powerups) if indicePowerup != None: powerup = powerups.pop(indicePowerup) diff --git a/sortie.txt b/sortie.txt index c4e2e7c..7cc0f37 100644 --- a/sortie.txt +++ b/sortie.txt @@ -1 +1 @@ -1 0 \ No newline at end of file +4 0 \ No newline at end of file