diff --git a/compil.sh b/compil.sh index a5fbb7d..0ff119f 100644 --- a/compil.sh +++ b/compil.sh @@ -1 +1,2 @@ -ocamlc main.ml -o main \ No newline at end of file +ocamlc main.ml -o main +./main \ No newline at end of file diff --git a/entrees.txt b/entrees.txt index b2c3b5d..1bee19f 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,22 +1,32 @@ -11.0 -3 +88.00000000000014 +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 3 3 2 2 2 2 2 0 2 2 0 2 2 2 2 2 2 5 5 1 -1 3 1 2 1 2 1 2 1 0 1 2 1 2 1 0 1 2 1 5 1 -1 0 2 2 2 2 2 2 2 2 2 0 2 2 2 2 2 2 0 2 1 -1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 -1 2 0 2 2 2 2 2 0 2 2 2 2 2 2 2 2 2 2 2 1 -1 2 1 2 1 2 1 0 1 2 1 2 1 2 1 2 1 2 1 2 1 -1 2 2 2 0 0 2 2 2 0 2 2 2 2 2 2 2 2 2 2 1 -1 2 1 2 1 2 1 0 1 2 1 2 1 2 1 2 1 2 1 2 1 -1 2 2 2 2 2 2 2 2 2 2 0 2 0 2 2 0 2 0 2 1 -1 0 1 2 1 0 1 2 1 0 1 2 1 2 1 2 1 2 1 0 1 -1 0 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 0 1 +1 3 3 3 3 0 0 2 2 2 2 2 2 0 0 5 5 5 5 5 1 +1 3 1 3 1 0 1 0 1 2 1 0 1 0 1 0 1 5 1 5 1 +1 3 3 3 3 0 2 2 2 2 0 0 0 2 2 2 0 5 5 5 1 +1 3 1 3 1 2 1 2 1 2 1 2 1 2 1 2 1 0 1 5 1 +1 0 0 3 0 2 2 2 2 2 0 2 2 2 2 0 2 2 0 5 1 +1 6 1 0 1 2 1 2 1 2 1 2 1 0 1 2 1 2 1 0 1 +1 6 0 0 2 0 2 2 2 2 2 2 2 0 0 2 2 2 2 0 1 +1 6 1 0 1 2 1 2 1 2 1 2 1 2 1 2 1 0 1 4 1 +1 6 6 6 0 2 2 2 2 2 2 2 0 2 2 2 0 4 4 4 1 +1 6 1 6 1 2 1 0 1 2 1 2 1 2 1 0 1 4 1 4 1 +1 6 6 6 0 2 2 2 2 2 2 2 2 2 0 4 4 4 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 -11 19 1 11.5 -2 -11 19 1 0 1 1 0 0 -11 1 3 0 1 1 0 0 -0 +3 +11 4 1 89.5 +3 5 3 89.90000000000012 +8 17 3 90.5 +4 +1 6 0 1 1 3 0 1 +9 17 1 0 1 3 1 1 +3 17 2 1 1 2 1 1 +9 3 3 0 1 1 3 1 +6 +7 19 2 +5 18 0 +5 4 0 +9 4 3 +10 15 2 +11 14 0 diff --git a/iachallenge2024_bomberman_tkinter.py b/iachallenge2024_bomberman_tkinter.py index 5341da7..f186ef3 100644 --- a/iachallenge2024_bomberman_tkinter.py +++ b/iachallenge2024_bomberman_tkinter.py @@ -339,7 +339,7 @@ def simulation(strategies): execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, joueurs, powerups, pieges) affiche_plateau(canvas, plateau, plateauCouleur, bombes, joueurs, powerups) affiche_infos(canvasInfosJoueurs, joueurs, plateauCouleur) - temps = int((evenements[0][0]-evenement[0])/3*1000) + temps = int((evenements[0][0]-evenement[0])/3*500) if temps != 0: fenetre.after(temps, pas_de_jeu) else: @@ -379,4 +379,4 @@ def simulation(strategies): return from importlib import import_module -simulation(["./main.ml", "./main.ml","./main.ml", "./main.ml"]) +simulation(["./main", "./main","./main", "./main"]) diff --git a/main b/main index 2392f9e..e580c83 100755 Binary files a/main and b/main differ diff --git a/main.cmi b/main.cmi index 1d5d113..64d3543 100644 Binary files a/main.cmi and b/main.cmi differ diff --git a/main.cmo b/main.cmo new file mode 100644 index 0000000..84b824d Binary files /dev/null and b/main.cmo differ diff --git a/main.ml b/main.ml index 3155149..88a9d44 100755 --- a/main.ml +++ b/main.ml @@ -1,4 +1,4 @@ -#! /home/alexandre/.opam/myswitch/bin/ocaml +(*#! /home/alexandre/.opam/myswitch/bin/ocaml *) (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) @@ -127,6 +127,10 @@ let level_of_danger = function let delta i j = if i = j then 1 else 0 ;; +let overwrite_file (filename : string) = + let ptr = open_out filename in + close_out ptr ;; + (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) @@ -556,7 +560,7 @@ let move_explore (gd: game_data) (dgs : danger array array) = res end else begin - if exit then + if false && exit then current_status := ClaimLand ; 4 end @@ -640,9 +644,15 @@ let update_strat (gd : game_data) (dgs : danger array array) = match dgs.(gd.pla (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) +let debug_game_data (gd : game_data) = + Printf.fprintf stderr "[player %d]\n" gd.player_id ;; + +(* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) +(* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) + get_meta_info () ;; -let game_d = parse_input "input_test.txt" ;; +let game_d = parse_input "entrees.txt" ;; let dangers = evaluate_dangers game_d ;; let gains = cell_values game_d ;; @@ -672,4 +682,6 @@ let main_actions () = match !current_status with main_actions () ; Printf.printf "%d" !action ; +debug_game_data game_d ;; + set_meta_info () ;; \ No newline at end of file diff --git a/main.sav b/main.sav index 56a6051..c227083 100644 --- a/main.sav +++ b/main.sav @@ -1 +1 @@ -1 \ No newline at end of file +0 \ No newline at end of file diff --git a/sortie.txt b/sortie.txt index 7cc0f37..4be3712 100644 --- a/sortie.txt +++ b/sortie.txt @@ -1 +1 @@ -4 0 \ No newline at end of file +4 1 \ No newline at end of file