diff --git a/csts.cmi b/csts.cmi index dc64b35..4d5b444 100644 Binary files a/csts.cmi and b/csts.cmi differ diff --git a/csts.cmx b/csts.cmx index da572c7..7595766 100644 Binary files a/csts.cmx and b/csts.cmx differ diff --git a/csts.ml b/csts.ml index 638d836..a7fe3af 100644 --- a/csts.ml +++ b/csts.ml @@ -30,7 +30,7 @@ let calc_length = ref 3 ;; let time_to_ans = ref 10 ;; let total_time = ref 60 ;; let n_inf = ref 1 ;; -let n_sup = ref 10 ;; +let n_sup = ref 100 ;; let time_to_ans_f = ref 10.0 ;; let total_time_f = ref 60.0 ;; diff --git a/csts.o b/csts.o index 62159ae..6d11b17 100644 Binary files a/csts.o and b/csts.o differ diff --git a/drawing.cmi b/drawing.cmi index e1b9607..443f294 100644 Binary files a/drawing.cmi and b/drawing.cmi differ diff --git a/drawing.cmx b/drawing.cmx index e759dea..c8fd917 100644 Binary files a/drawing.cmx and b/drawing.cmx differ diff --git a/maeth.cmi b/maeth.cmi index c83cd6a..7f68cd2 100644 Binary files a/maeth.cmi and b/maeth.cmi differ diff --git a/maeth.cmx b/maeth.cmx index 87fe4bd..ad0041d 100644 Binary files a/maeth.cmx and b/maeth.cmx differ diff --git a/maeth.ml b/maeth.ml index 0196a6a..10deb43 100644 --- a/maeth.ml +++ b/maeth.ml @@ -81,21 +81,21 @@ let int_of_bool = function let fm_length (fm : operation) (size : int) = let rec aux = function - | Val _ -> size*11/7 + | Val k -> size*11/7*(1 + Math.ln_b 10 k) | Exp(f, k) -> size*11/7 (* not implemented*) | Sum(f, g) | Diff(f, g) | Prod(f, g) -> - size*11/7 + (int_of_bool (require_bracket f) + int_of_bool (require_bracket g))*size/2 + aux f + aux g + size*10/7 + (int_of_bool (require_bracket f) + int_of_bool (require_bracket g))*(size/2+12) + aux f + aux g (* sign + brackets + recursive calls *) in aux fm ;; let print_calc (f : operation) (x0 : int) (y0 : int) (size : int) = set_line_width 3 ; let fmlen = fm_length f size in - let x = ref (x0 - fmlen/2) in + let x = ref (x0) in set_color (rgb 192 192 0) ; - fill_rect (x0 - fmlen/2 - 6) (y0 - size - 6) (fmlen+12) (2*size + 12) ; + fill_rect (x0 -6) (y0 - size - 6) (fmlen+12) (2*size + 12) ; set_color black ; let rec aux = function | Val k -> @@ -217,7 +217,7 @@ let maeth_main () = clear_graph () ; set_color black ; - print_calc equ (Csts.__width__/2) (Csts.__height__/2) 15 ; + print_calc equ (10) (Csts.__height__/2) 15 ; Drawing.draw_string_centered (Csts.__width__/2) (Csts.__height__/3) "Answer" 50 ; Drawing.draw_integer (Csts.__width__/2) (Csts.__height__/3 - 100) !Csts.ans 75 ; diff --git a/maeth.o b/maeth.o index 753f254..856c3d8 100644 Binary files a/maeth.o and b/maeth.o differ diff --git a/main.cmi b/main.cmi index 6f7af75..fb2a3bc 100644 Binary files a/main.cmi and b/main.cmi differ diff --git a/main.cmx b/main.cmx index 684831e..0ff8e0d 100644 Binary files a/main.cmx and b/main.cmx differ diff --git a/main.ml b/main.ml index 89015cc..7579f44 100644 --- a/main.ml +++ b/main.ml @@ -22,7 +22,7 @@ let rec mainloop () = Csts.max_score := 100 * !Csts.difficulty - * !Csts.calc_length * int_of_float (Float.sqrt (float_of_int !Csts.calc_length)) + * (Math.pw !Csts.calc_length 3) * (90 / !Csts.time_to_ans) * int_of_float (Float.sqrt (float_of_int (90 / !Csts.time_to_ans))) ; Maeth.init_odds () ; clear_graph () ; diff --git a/main.o b/main.o index 6a84e68..bb93342 100644 Binary files a/main.o and b/main.o differ diff --git a/math b/math index 66ec3bd..f5d3b76 100755 Binary files a/math and b/math differ diff --git a/menus.cmi b/menus.cmi index ad11228..6830628 100644 Binary files a/menus.cmi and b/menus.cmi differ diff --git a/menus.cmx b/menus.cmx index a561a80..9301f40 100644 Binary files a/menus.cmx and b/menus.cmx differ diff --git a/menus.ml b/menus.ml index 916ae9c..37fbb2d 100644 --- a/menus.ml +++ b/menus.ml @@ -372,9 +372,9 @@ build_button "Exit" {x = Csts.__width__/2 - 150; y = 50; w = 300; h = 100} build_button "Minimum" {x = Csts.__width__/2 - 200; y = 710; w = 400; h = 100} 255 128 32 (Tweak (build_tweak Csts.n_inf 1 1000 1 [] [Csts.n_sup])) ;; build_button "Maximum" {x = Csts.__width__/2 - 200; y = 600; w = 400; h = 100} 128 255 32 (Tweak (build_tweak Csts.n_sup 1 1000 1 [Csts.n_inf] [])) ;; -build_button "Length" {x = Csts.__width__/2 - 200; y = 490; w = 400; h = 100} 255 32 32 (Tweak (build_tweak Csts.calc_length 2 20 1 [] [])) ;; -build_button "Answer time" {x = Csts.__width__/2 - 200; y = 380; w = 400; h = 100} 32 192 32 (Tweak (build_tweak Csts.time_to_ans 3 30 1 [] [])) ;; -build_button "Total time" {x = Csts.__width__/2 - 200; y = 270; w = 400; h = 100} 32 255 32 (Tweak (build_tweak Csts.total_time 15 600 1 [] [])) ;; +build_button "Length" {x = Csts.__width__/2 - 200; y = 490; w = 400; h = 100} 255 32 32 (Tweak (build_tweak Csts.calc_length 2 12 1 [] [])) ;; +build_button "Answer time" {x = Csts.__width__/2 - 200; y = 380; w = 400; h = 100} 32 192 32 (Tweak (build_tweak Csts.time_to_ans 3 60 1 [] [])) ;; +build_button "Total time" {x = Csts.__width__/2 - 200; y = 270; w = 400; h = 100} 32 255 32 (Tweak (build_tweak Csts.total_time 15 3600 1 [] [])) ;; build_button "Difficulty" {x = Csts.__width__/2 - 200; y = 160; w = 400; h = 100} 32 32 255 (Tweak (build_tweak Csts.difficulty 1 10 1 [] [])) ;; build_button "Back" {x = Csts.__width__/2 - 200; y = 50; w = 400; h = 100} 32 32 32 (Warp 0) ;; diff --git a/menus.o b/menus.o index d1c6423..7f4504d 100644 Binary files a/menus.o and b/menus.o differ