uhhhhhhhhhhhh
This commit is contained in:
parent
14dae2a4cb
commit
3e9adf8e2f
22
again.ml
22
again.ml
|
@ -578,7 +578,7 @@ let generate_dead_end_map (gd : game_data) =
|
|||
let visited = Hashtbl.create (lines * cols) in
|
||||
|
||||
(* places 0s to connectable tiles *)
|
||||
let rec dfs x y prev last_dir =
|
||||
let rec dfs x y prev last_dir fpass =
|
||||
if
|
||||
(is_valid x y lines cols) &&
|
||||
(Hashtbl.find_opt visited (x, y) = None) &&
|
||||
|
@ -592,19 +592,19 @@ let generate_dead_end_map (gd : game_data) =
|
|||
Hashtbl.remove visited (x, y) ;
|
||||
List.iter (fun (cx, cy) -> res.(cx).(cy) <- 0) ((x, y)::prev) ;
|
||||
for dir = 0 to 3 do
|
||||
if (dir + 2) mod 4 <> last_dir then (* dont backtrack *)
|
||||
dfs (x + fst (order.(dir))) (y + snd (order.(dir))) [] dir
|
||||
if fpass || (dir + 2) mod 4 <> last_dir then (* dont backtrack *)
|
||||
dfs (x + fst (order.(dir))) (y + snd (order.(dir))) [] dir false
|
||||
done
|
||||
end
|
||||
else begin
|
||||
for dir = 0 to 3 do
|
||||
if (dir + 2) mod 4 <> last_dir then
|
||||
dfs (x + fst (order.(dir))) (y + snd (order.(dir))) ((x, y)::prev) dir
|
||||
dfs (x + fst (order.(dir))) (y + snd (order.(dir))) ((x, y)::prev) dir fpass
|
||||
done
|
||||
end
|
||||
end
|
||||
in
|
||||
dfs gd.players.(pid).xy.x gd.players.(pid).xy.y [] 4;
|
||||
dfs gd.players.(pid).xy.x gd.players.(pid).xy.y [] 4 true;
|
||||
|
||||
(* fills remaining spaces with BFS *)
|
||||
let bfs (x0 : int) (y0 : int) =
|
||||
|
@ -812,7 +812,7 @@ let bfs_for_crate ?return_x:(retx=fodder) ?return_y:(rety=fodder) (gd : game_dat
|
|||
|
||||
let undead_end_tiles = generate_dead_end_map gd in
|
||||
|
||||
if false && gd.player_id = 0 then begin
|
||||
if gd.player_id = 2 then begin
|
||||
for l = 0 to Array.length undead_end_tiles -1 do
|
||||
for c = 0 to Array.length undead_end_tiles.(l) -1 do
|
||||
if undead_end_tiles.(l).(c) >= 727 then
|
||||
|
@ -844,8 +844,8 @@ let bfs_for_crate ?return_x:(retx=fodder) ?return_y:(rety=fodder) (gd : game_dat
|
|||
not (Array.fold_left (fun acc (b : bomb) -> acc || (b.xy.x = x && b.xy.y = y)) false gd.bombs) &&
|
||||
polar <= 4
|
||||
then begin (* is not lethal *)
|
||||
if ct = stime +. interval then begin
|
||||
Printf.fprintf stderr "%b %b %b %b %b\n"
|
||||
if false && ct <= stime +. 3. *. interval then begin
|
||||
Printf.fprintf stderr "(at %d %d) %b %b %b %b %b\n" x y
|
||||
(ct >= stime +. (float_of_int minDist) *. interval) (* not too deep *)
|
||||
(is_empty_lst dgs.explosionTimes.(x).(y)) (* safe *)
|
||||
(needs_gtfo || undead_end_tiles.(x).(y) * 2 <= nearest_player) (* is not going to be an ez kill *)
|
||||
|
@ -888,7 +888,7 @@ let move_crate (gd : game_data) (dgs : danger_map) =
|
|||
if logg then Printf.fprintf stderr "oh no you dont\n" ;
|
||||
let saved_p = simulate_bomb_deconstruct dgs cxi cyi gd.players.(pid).bomb_radius (gd.dt +. 5.5) in
|
||||
|
||||
let bonusres_2p = bfs_for_crate gd dgs cxi cyi gd.dt false true false 0 false 7 in
|
||||
let bonusres_2p = bfs_for_crate gd dgs cxi cyi gd.dt false true false 0 false 5 in
|
||||
if bonusres_2p <> 4 then begin
|
||||
if logg then Printf.fprintf stderr "mine\n" ;
|
||||
raise (ReturnInt bonusres_2p) ;
|
||||
|
@ -909,7 +909,7 @@ let move_crate (gd : game_data) (dgs : danger_map) =
|
|||
let saved = simulate_bomb_deconstruct dgs cxi cyi gd.players.(pid).bomb_radius (gd.dt +. 5.5) in
|
||||
let bonus2_x = ref 0
|
||||
and bonus2_y = ref 0 in
|
||||
let bonusres_2 = bfs_for_crate ~return_x:bonus2_x ~return_y:bonus2_y gd dgs cxi cyi gd.dt false true false 0 false 7 in
|
||||
let bonusres_2 = bfs_for_crate ~return_x:bonus2_x ~return_y:bonus2_y gd dgs cxi cyi gd.dt false true false 0 false 5 in
|
||||
if bonusres_2 <> 4 && (tile_distance gd cxi cyi !bonus2_x !bonus2_y <= min_dist_from_player gd cxi cyi) then begin
|
||||
if logg then Printf.fprintf stderr "Bonus Spotted\n" ;
|
||||
action := 1 ;
|
||||
|
@ -930,7 +930,7 @@ let move_crate (gd : game_data) (dgs : danger_map) =
|
|||
if logg then Printf.fprintf stderr "bonusing...\n" ;
|
||||
let bonus_x = ref 0
|
||||
and bonus_y = ref 0 in
|
||||
let bonusres = bfs_for_crate ~return_x:bonus_x ~return_y:bonus_y gd dgs cxi cyi gd.dt false true false 0 false 7 in
|
||||
let bonusres = bfs_for_crate ~return_x:bonus_x ~return_y:bonus_y gd dgs cxi cyi gd.dt false true false 0 false 5 in
|
||||
if bonusres <> 4 && (tile_distance gd cxi cyi !bonus_x !bonus_y <= min_dist_from_player gd cxi cyi) then begin
|
||||
if logg then Printf.fprintf stderr "bonus spotted\n" ;
|
||||
raise (ReturnInt bonusres) ;
|
||||
|
|
45
entrees.txt
45
entrees.txt
|
@ -1,29 +1,24 @@
|
|||
97.00000000000013
|
||||
0
|
||||
330.0
|
||||
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 3 3 3 0 2 2 0 2 2 0 5 5 5 5 5 5 5 5 1
|
||||
1 3 1 3 1 2 1 2 1 2 1 2 1 0 1 2 1 5 1 5 1
|
||||
1 3 3 3 0 2 2 2 2 2 2 2 0 2 2 0 0 5 5 5 1
|
||||
1 6 1 3 1 0 1 2 1 2 1 2 1 2 1 0 1 5 1 5 1
|
||||
1 6 0 2 0 2 0 2 0 0 2 2 2 2 0 4 5 5 5 5 1
|
||||
1 6 1 0 1 2 1 2 1 2 1 0 1 2 1 4 1 5 1 0 1
|
||||
1 6 0 2 2 2 2 2 2 2 2 2 0 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