diff --git a/again b/again index 7feb98f..0068d05 100755 Binary files a/again and b/again differ diff --git a/again.cmi b/again.cmi index f69c408..f499970 100644 Binary files a/again.cmi and b/again.cmi differ diff --git a/again.cmx b/again.cmx index 126a2d9..fb40e82 100644 Binary files a/again.cmx and b/again.cmx differ diff --git a/again.ml b/again.ml index a67e925..2e4659b 100644 --- a/again.ml +++ b/again.ml @@ -233,7 +233,7 @@ let set_meta_info (pid : int) = (* ---------------------------------------------------------------------------------------------------------------------------------------------------- *) let int_of_string (str : string) = - String.fold_right (fun ch acc -> let cd = Char.code ch in if cd >= 48 || cd <= 57 then 10*acc + cd - 48 else failwith "not an integer\n") str 0 ;; + String.fold_left (fun acc ch -> let cd = Char.code ch in if cd >= 48 || cd <= 57 then 10*acc + cd - 48 else failwith "not an integer\n") 0 str ;; let string_of_int (k0 : int) = String.make (1) (Char.chr (k0 + 48)) ;; @@ -522,8 +522,8 @@ let amt_free_adj_spaces (gd : game_data) (x : int) (y : int) = 0 order ;; -let max_depth = 3 ;; -let max_spacing = 3 ;; +let max_depth = 4 ;; +let max_spacing = 4 ;; let is_player_nearby (gd : game_data) (res_x : int ref) (res_y : int ref) = let pid = gd.player_id in let lines = Array.length gd.laby @@ -923,13 +923,13 @@ let draw_random (gd : game_data) (infx : int) (infy : int) (lines : int) (cols : (* get a random, valid tile *) let xres = ref (-1) and yres = ref (-1) in - while not (is_valid !xres !yres lines cols && gd.laby.(!xres).(!yres) <> 1 && gd.laby.(!xres).(!yres) <> 2 && not (Array.fold_left (fun acc (b : bomb) -> acc || (b.xy.x = !xres && b.xy.y = !yres)) false gd.bombs)) do + while not (is_valid !xres !yres lines cols && gd.laby.(!xres).(!yres) >= 3 && gd.laby.(!xres).(!yres) <> 3 + gd.player_id && not (Array.fold_left (fun acc (b : bomb) -> acc || (b.xy.x = !xres && b.xy.y = !yres)) false gd.bombs)) do xres := infx + Random.int (lines - infx) ; yres := infy + Random.int (cols - infy) ; done; (!xres, !yres) ;; -let nloops = 40 ;; +let nloops = 70 ;; let move_land_2 (gd : game_data) (dgs : danger_map) (gns : int array array) = let lines = Array.length gd.laby and cols = Array.length gd.laby.(0) in @@ -943,7 +943,11 @@ let move_land_2 (gd : game_data) (dgs : danger_map) (gns : int array array) = let (x, y) = draw_random gd 0 0 lines cols 4 in let result_0 = goto_tile gd dgs cxi cyi x y gd.dt in if result_0 <> 4 then begin - if gd.players.(pid).nbomb_atonce > 0 && not (Array.fold_left (fun acc (b : bomb) -> acc || (b.xy.x = cxi && b.xy.y = cyi)) false gd.bombs) then begin + if + gd.players.(pid).nbomb_atonce > 0 && + not (Array.fold_left (fun acc (b : bomb) -> acc || (b.xy.x = cxi && b.xy.y = cyi)) false gd.bombs) && + (is_empty_lst dgs.explosionTimes.(cxi).(cyi)) + then begin if logg then Printf.fprintf stderr "trying...\n" ; let _ = simulate_bomb_deconstruct dgs cxi cyi gd.players.(pid).bomb_radius (gd.dt +. 5.5) in let result = goto_tile gd dgs cxi cyi x y gd.dt in diff --git a/again.o b/again.o index 115750f..7a3cfed 100644 Binary files a/again.o and b/again.o differ diff --git a/entrees.txt b/entrees.txt index a9523fb..b639384 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,29 +1,31 @@ -225.80000000000052 -0 +457.50401999999656 +3 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 6 6 5 5 5 4 5 5 5 5 5 5 5 3 3 3 3 5 1 -1 3 1 6 1 0 1 4 1 5 1 5 1 5 1 3 1 3 1 5 1 -1 3 3 3 4 4 4 4 4 4 5 5 5 5 5 3 5 3 5 5 1 -1 3 1 3 1 3 1 4 1 4 1 5 1 5 1 3 1 3 1 5 1 -1 3 3 3 4 4 4 4 4 4 4 5 3 3 3 3 3 3 3 3 1 -1 3 1 3 1 3 1 4 1 4 1 5 1 5 1 3 1 3 1 5 1 -1 3 3 3 3 3 3 5 5 5 5 5 5 5 5 3 3 3 3 3 1 -1 0 1 3 1 3 1 4 1 4 1 5 1 3 1 3 1 3 1 4 1 -1 3 3 3 3 3 3 3 3 3 3 5 3 3 3 3 3 3 3 4 1 -1 6 1 3 1 3 1 4 1 5 1 5 1 3 1 3 1 3 1 4 1 -1 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 5 1 +1 3 3 0 6 3 3 3 3 3 3 3 3 3 5 5 5 5 5 6 1 +1 3 1 0 1 6 1 3 1 3 1 3 1 3 1 5 1 5 1 5 1 +1 5 3 6 6 6 6 3 5 5 5 5 5 3 5 5 5 5 3 3 1 +1 6 1 6 1 6 1 3 1 4 1 4 1 3 1 5 1 5 1 5 1 +1 6 6 6 6 6 3 3 3 3 3 3 3 3 3 5 5 5 5 5 1 +1 6 1 6 1 6 1 3 1 3 1 6 1 3 1 5 1 5 1 4 1 +1 6 6 6 6 6 6 6 6 6 6 6 4 4 5 5 6 5 0 4 1 +1 6 1 6 1 6 1 6 1 3 1 6 1 4 1 6 1 3 1 4 1 +1 6 6 6 4 6 3 6 6 6 6 6 6 4 3 3 3 3 3 3 1 +1 6 1 6 1 6 1 6 1 6 1 6 1 4 1 6 1 3 1 4 1 +1 6 6 5 6 6 6 6 6 6 6 6 4 4 4 4 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -7 -3 13 5 225.9000000000005 -8 9 2 225.91200000000183 -9 9 2 226.64100000000184 -4 13 5 226.8000000000005 -5 13 5 227.7000000000005 -6 13 5 228.6000000000005 -11 11 3 230.7100000000007 -3 -7 15 0 1 0 5 1 2 -9 12 1 3 0 2 3 3 -10 11 2 2 1 3 3 0 +8 +7 13 2 457.7330299999967 +7 10 2 459.4610799999966 +2 9 1 459.5 +8 9 2 460.68547999999663 +1 13 2 460.9700000000011 +5 11 2 461.2325499999966 +7 7 2 462.4569499999966 +3 7 1 462.5 +4 +8 7 0 5 2 2 1 0 +4 7 1 0 2 1 0 1 +2 11 2 2 2 2 0 0 +5 14 3 5 2 2 6 6 0 diff --git a/sortie.txt b/sortie.txt index 69035af..92880af 100644 --- a/sortie.txt +++ b/sortie.txt @@ -1 +1 @@ -3 0 \ No newline at end of file +1 1 \ No newline at end of file