what have I done ?
This commit is contained in:
parent
ef0dcc9e5e
commit
f3f26c5284
8
again.ml
8
again.ml
|
@ -11,7 +11,7 @@ TODO :
|
|||
Random.self_init () ;;
|
||||
|
||||
let debug_all = false ;;
|
||||
let logg = true ;;
|
||||
let logg = false ;;
|
||||
|
||||
let remaining_dash = ref 0. ;;
|
||||
|
||||
|
@ -693,7 +693,7 @@ let reverse_simulate_bomb (dgs : danger_map) (save : (int * int, float) Hashtbl.
|
|||
let is_dead (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) =
|
||||
(List.fold_left (* bombs *)
|
||||
(fun acc expl_time ->
|
||||
acc || (t >= expl_time && t <= expl_time +. dt) || (t >= expl_time -. dt && t <= expl_time)
|
||||
acc || (t >= expl_time && t <= expl_time +. dt)(**|| (t >= expl_time -. dt && t <= expl_time)*)
|
||||
)
|
||||
false
|
||||
dgs.explosionTimes.(x).(y)
|
||||
|
@ -708,7 +708,7 @@ let is_dead (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) =
|
|||
let is_dead_2 (dgs : danger_map) (x : int) (y : int) (t : float) (dt : float) =
|
||||
(List.fold_left
|
||||
(fun acc expl_time ->
|
||||
acc || (t >= expl_time && t <= expl_time +. dt) || (t >= expl_time -. dt && t <= expl_time)
|
||||
acc || (t >= expl_time && t <= expl_time +. dt)(* || (t >= expl_time -. dt && t <= expl_time)*)
|
||||
)
|
||||
false
|
||||
dgs.explosionTimes.(x).(y)
|
||||
|
@ -1384,7 +1384,7 @@ let gain_map = generate_gain_map game_map danger_data ;;
|
|||
|
||||
get_rem_dash ("again"^(string_of_int game_map.player_id)^".sav") ;;
|
||||
|
||||
Printf.fprintf stderr "\n" ;;
|
||||
(*Printf.fprintf stderr "\n" ;;*)
|
||||
if game_map.player_id = 4 then begin
|
||||
for l = 0 to Array.length gain_map -1 do
|
||||
for c = 0 to Array.length gain_map.(l) -1 do
|
||||
|
|
45
entrees.txt
45
entrees.txt
|
@ -1,28 +1,27 @@
|
|||
89.0
|
||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6 1 0 1 2 1 2 1 2 1 0 1 4 1 4 1 4 1
|
||||
1 6 6 6 6 6 0 2 2 2 0 4 4 4 4 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
|
||||
2
|
||||
11 14 2 89.5
|
||||
5 15 1 93.10000000000008
|
||||
2
|
||||
9 17 1 0 3 2 0 2
|
||||
3 15 2 1 2 1 1 0
|
||||
5
|
||||
1
|
||||
5 16 4 122.30000000000013
|
||||
1
|
||||
7 14 1 1 3 4 0 0
|
||||
6
|
||||
6 5 4
|
||||
1 6 3
|
||||
10 5 0
|
||||
9 14 2
|
||||
8 15 0
|
||||
1 12 3
|
||||
9 12 4
|
||||
10 13 2
|
||||
7 13 0
|
||||
2 13 4
|
||||
|
|
|
@ -294,7 +294,7 @@ int get_data(char* filename, int** board, bool* ended) {
|
|||
*ended = true ;
|
||||
}
|
||||
|
||||
fprintf(stderr, "(%d, %d, %d, %d, %d)\n", cur_t, maze_w, maze_h, nbombs, nplayers);
|
||||
//fprintf(stderr, "(%d, %d, %d, %d, %d)\n", cur_t, maze_w, maze_h, nbombs, nplayers);
|
||||
|
||||
fclose(ptr) ;
|
||||
return cur_t ;
|
||||
|
@ -360,6 +360,9 @@ void update_graph(SDL_Renderer* renderer, int** board, int current_time) {
|
|||
int yc = convex_pt(bot_y, top_y, 1.0f - ((float)(max(0, board[tmax][pl])))/((float)(max_val+1))) ;
|
||||
drawIntegerToRenderer(renderer, mval, 2, right_x+2-20*(-1+ln_b(10, mval)), yc+14-2*2, 14, 14, 255*(pl==0)+192*(pl==3), 255*(pl==2)+192*(pl==3), 255*(pl==1), 128) ;
|
||||
}
|
||||
|
||||
drawIntegerToRenderer(renderer, current_time, 2, 375, 105/3+3, 75/3, 105/3, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
|
||||
updateRenderer(renderer) ;
|
||||
}
|
||||
|
||||
|
|
|
@ -383,7 +383,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo
|
|||
elif joueurs[indiceJoueur][J_PIEGESRESTANTS]>0 and action == A_PIEGE:
|
||||
joueur[J_PIEGESRESTANTS]-=1
|
||||
pieges.append([i,j,indiceJoueur])
|
||||
print("||||| trap at", i, j, "|||||")
|
||||
#print("||||| trap at", i, j, "|||||")
|
||||
|
||||
i, j = joueur[J_LIGNE], joueur[J_COLONNE]
|
||||
indicePiege = trouve_objet(i,j, pieges)
|
||||
|
@ -392,16 +392,16 @@ 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, ")||||||||")
|
||||
print("[CONSOLE]", indiceJoueur, "has triggered", piege[P_JOUEUR], "'s trap (at", i, j, "), time =", temps, ")")
|
||||
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)
|
||||
#print(joueur[J_LIGNE], joueur[J_COLONNE], "--->", ip, jp)
|
||||
joueur[J_LIGNE]=ip
|
||||
joueur[J_COLONNE]=jp
|
||||
else:
|
||||
print("still")
|
||||
#else:
|
||||
#print("still")
|
||||
|
||||
i, j = joueur[J_LIGNE], joueur[J_COLONNE]
|
||||
indicePowerup = trouve_objet(i,j,powerups)
|
||||
|
@ -458,7 +458,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo
|
|||
indiceJoueur = trouve_objet(i,j,joueurs)
|
||||
while indiceJoueur != None:
|
||||
joueurs[indiceJoueur] = None
|
||||
print("\n--------------------------------------------------------------------------------------------------------\n\nDEATH (at time =", evenement[0], "):", indiceJoueur, "\n\n--------------------------------------------------------------------------------------------------------\n")
|
||||
print("[CONSOLE] DEATH (time =", evenement[0], "):", indiceJoueur, "\n")
|
||||
#assert(false)
|
||||
indiceJoueur = trouve_objet(i,j,joueurs)
|
||||
|
||||
|
@ -580,7 +580,7 @@ def simulation(strategies):
|
|||
joueurs = []
|
||||
|
||||
for i in range(len(strategies)):
|
||||
joueur = [positionsInitiales[i][0], positionsInitiales[i][1], strategies[i], 0, 1, 1, 1, 1, 0, 0, 0]
|
||||
joueur = [positionsInitiales[i][0], positionsInitiales[i][1], strategies[i], 0, 1, 1, 1, 0, 0, 0, 0]
|
||||
joueurs.append(joueur)
|
||||
ajoute_evenement(evenements, [0., EVENEMENT_TOUR_JOUEUR, i])
|
||||
|
||||
|
|
Loading…
Reference in New Issue