value changes
This commit is contained in:
parent
b7a09d6a8a
commit
21f2b79a4b
16
again.ml
16
again.ml
|
@ -233,7 +233,7 @@ let set_meta_info (pid : int) =
|
||||||
(* ---------------------------------------------------------------------------------------------------------------------------------------------------- *)
|
(* ---------------------------------------------------------------------------------------------------------------------------------------------------- *)
|
||||||
|
|
||||||
let int_of_string (str : string) =
|
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) =
|
let string_of_int (k0 : int) =
|
||||||
String.make (1) (Char.chr (k0 + 48)) ;;
|
String.make (1) (Char.chr (k0 + 48)) ;;
|
||||||
|
@ -522,8 +522,8 @@ let amt_free_adj_spaces (gd : game_data) (x : int) (y : int) =
|
||||||
0
|
0
|
||||||
order ;;
|
order ;;
|
||||||
|
|
||||||
let max_depth = 3 ;;
|
let max_depth = 4 ;;
|
||||||
let max_spacing = 3 ;;
|
let max_spacing = 4 ;;
|
||||||
let is_player_nearby (gd : game_data) (res_x : int ref) (res_y : int ref) =
|
let is_player_nearby (gd : game_data) (res_x : int ref) (res_y : int ref) =
|
||||||
let pid = gd.player_id in
|
let pid = gd.player_id in
|
||||||
let lines = Array.length gd.laby
|
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 *)
|
(* get a random, valid tile *)
|
||||||
let xres = ref (-1)
|
let xres = ref (-1)
|
||||||
and yres = ref (-1) in
|
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) ;
|
xres := infx + Random.int (lines - infx) ;
|
||||||
yres := infy + Random.int (cols - infy) ;
|
yres := infy + Random.int (cols - infy) ;
|
||||||
done;
|
done;
|
||||||
(!xres, !yres) ;;
|
(!xres, !yres) ;;
|
||||||
|
|
||||||
let nloops = 40 ;;
|
let nloops = 70 ;;
|
||||||
let move_land_2 (gd : game_data) (dgs : danger_map) (gns : int array array) =
|
let move_land_2 (gd : game_data) (dgs : danger_map) (gns : int array array) =
|
||||||
let lines = Array.length gd.laby
|
let lines = Array.length gd.laby
|
||||||
and cols = Array.length gd.laby.(0) in
|
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 (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
|
let result_0 = goto_tile gd dgs cxi cyi x y gd.dt in
|
||||||
if result_0 <> 4 then begin
|
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" ;
|
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 _ = 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
|
let result = goto_tile gd dgs cxi cyi x y gd.dt in
|
||||||
|
|
52
entrees.txt
52
entrees.txt
|
@ -1,29 +1,31 @@
|
||||||
225.80000000000052
|
457.50401999999656
|
||||||
0
|
3
|
||||||
13 21
|
13 21
|
||||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
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 3 0 6 3 3 3 3 3 3 3 3 3 5 5 5 5 5 6 1
|
||||||
1 3 1 6 1 0 1 4 1 5 1 5 1 5 1 3 1 3 1 5 1
|
1 3 1 0 1 6 1 3 1 3 1 3 1 3 1 5 1 5 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 5 3 6 6 6 6 3 5 5 5 5 5 3 5 5 5 5 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 6 1 6 1 6 1 3 1 4 1 4 1 3 1 5 1 5 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 6 6 6 6 6 3 3 3 3 3 3 3 3 3 5 5 5 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 6 1 6 1 6 1 3 1 3 1 6 1 3 1 5 1 5 1 4 1
|
||||||
1 3 3 3 3 3 3 5 5 5 5 5 5 5 5 3 3 3 3 3 1
|
1 6 6 6 6 6 6 6 6 6 6 6 4 4 5 5 6 5 0 4 1
|
||||||
1 0 1 3 1 3 1 4 1 4 1 5 1 3 1 3 1 3 1 4 1
|
1 6 1 6 1 6 1 6 1 3 1 6 1 4 1 6 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 6 6 4 6 3 6 6 6 6 6 6 4 3 3 3 3 3 3 1
|
||||||
1 6 1 3 1 3 1 4 1 5 1 5 1 3 1 3 1 3 1 4 1
|
1 6 1 6 1 6 1 6 1 6 1 6 1 4 1 6 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 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
|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
7
|
8
|
||||||
3 13 5 225.9000000000005
|
7 13 2 457.7330299999967
|
||||||
8 9 2 225.91200000000183
|
7 10 2 459.4610799999966
|
||||||
9 9 2 226.64100000000184
|
2 9 1 459.5
|
||||||
4 13 5 226.8000000000005
|
8 9 2 460.68547999999663
|
||||||
5 13 5 227.7000000000005
|
1 13 2 460.9700000000011
|
||||||
6 13 5 228.6000000000005
|
5 11 2 461.2325499999966
|
||||||
11 11 3 230.7100000000007
|
7 7 2 462.4569499999966
|
||||||
3
|
3 7 1 462.5
|
||||||
7 15 0 1 0 5 1 2
|
4
|
||||||
9 12 1 3 0 2 3 3
|
8 7 0 5 2 2 1 0
|
||||||
10 11 2 2 1 3 3 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
|
0
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3 0
|
1 1
|
Loading…
Reference in New Issue