diff options
Diffstat (limited to 'calculette_aoo/bin/main.ml')
-rw-r--r-- | calculette_aoo/bin/main.ml | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/calculette_aoo/bin/main.ml b/calculette_aoo/bin/main.ml new file mode 100644 index 0000000..c738cd7 --- /dev/null +++ b/calculette_aoo/bin/main.ml @@ -0,0 +1,49 @@ +let cout_a = (800, 200, 100) +let cout_m = (110, 55, 35) +let cout_rm = (50, 40, 20) +let cout_pm = (5, 3, 1) +let cout_fm = (100, 50, 30) +let fm_oponent = 10 + +let env : Aoo.Build.env = + { + cost_max = 1800 + ; max_tours = 5.0 + ; cout_sort = 8 + ; degat_sort = 6 + ; fm_oponent + ; frequencies = Aoo.Build.buil_freq_table 9 fm_oponent + } + +(* +let () = Random.self_init () + +let roll_and_accumulate dices = + Seq.repeat () |> Seq.take dices + |> Seq.fold_left (fun res _ -> res + (1 + Random.int 6)) 0 + +let delta_carac level = + Seq.repeat () |> Seq.take 1000000 + |> Seq.fold_left + (fun acc _ -> + if roll_and_accumulate level > roll_and_accumulate (level - 2) then acc + else acc + 1) + 0 +*) + +(* Définition des caractéristiques *) +let a = Aoo.Carac.create 2 cout_a +let m = Aoo.Carac.create 5 cout_m +let rm = Aoo.Carac.create 7 cout_rm +let pm = Aoo.Carac.create 40 cout_pm +let fm = Aoo.Carac.create 9 cout_fm +let default = Aoo.Build.{ a; m; rm; pm; fm } + +let () = + let build = + Aoo.Build.traverse env + (Aoo.Build.cost default, Aoo.Build.score env default) + (Aoo.Build.upgrade env default) + in + + Aoo.Build.repr env Format.std_formatter build |