diff --git a/csts.cmi b/csts.cmi index 4d5b444..f063e88 100644 Binary files a/csts.cmi and b/csts.cmi differ diff --git a/csts.cmx b/csts.cmx index 7595766..94f15e2 100644 Binary files a/csts.cmx and b/csts.cmx differ diff --git a/csts.ml b/csts.ml index a7fe3af..a2bba69 100644 --- a/csts.ml +++ b/csts.ml @@ -47,5 +47,6 @@ and minus_ch = ref 8 and prod_ch = ref 2 ;; let ans = ref 0 ;; +let n_ans = ref 0 ;; let max_score = ref 1000 ;; \ No newline at end of file diff --git a/csts.o b/csts.o index 6d11b17..37fbd5b 100644 Binary files a/csts.o and b/csts.o differ diff --git a/drawing.cmi b/drawing.cmi index 443f294..20c7f3a 100644 Binary files a/drawing.cmi and b/drawing.cmi differ diff --git a/drawing.cmx b/drawing.cmx index c8fd917..663614c 100644 Binary files a/drawing.cmx and b/drawing.cmx differ diff --git a/drawing.o b/drawing.o index 7250bf7..1c814d4 100644 Binary files a/drawing.o and b/drawing.o differ diff --git a/dynamic.cmx b/dynamic.cmx index 54b4b92..bc06cad 100644 Binary files a/dynamic.cmx and b/dynamic.cmx differ diff --git a/dynamic.o b/dynamic.o index a17f750..8c80b26 100644 Binary files a/dynamic.o and b/dynamic.o differ diff --git a/maeth.cmi b/maeth.cmi index 7f68cd2..e388c68 100644 Binary files a/maeth.cmi and b/maeth.cmi differ diff --git a/maeth.cmx b/maeth.cmx index ad0041d..7f7b591 100644 Binary files a/maeth.cmx and b/maeth.cmx differ diff --git a/maeth.ml b/maeth.ml index 10deb43..a8ec987 100644 --- a/maeth.ml +++ b/maeth.ml @@ -247,6 +247,7 @@ let maeth_main () = cur := Unix.gettimeofday () ; done ; Csts.ans := 0 ; + incr Csts.n_ans ; if (!cur -. !Csts.start_0) > !Csts.total_time_f then true else if !found then begin @@ -276,24 +277,29 @@ let result_screen () = Drawing.draw_string_centered (Csts.__width__/2) (Csts.__height__ - 60) "Press space to return to main" 22 ; set_color (rgb 192 192 0) ; - Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 + 70) "Score" 20 ; + Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 + 140) "Score" 20 ; set_color (rgb 255 255 0) ; - Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(5+1)*10/7) (Csts.__height__/2 + 70) !Csts.score 20 ; + Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(5+1)*10/7) (Csts.__height__/2 + 140) !Csts.score 20 ; set_color (rgb 0 192 0) ; - Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2) "Max Combo" 20 ; + Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 + 70) "Max Combo" 20 ; set_color (rgb 0 255 0) ; - Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(9+1)*10/7) (Csts.__height__/2) !Csts.max_combo 20 ; + Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(9+1)*10/7) (Csts.__height__/2 + 70) !Csts.max_combo 20 ; set_color (rgb 0 192 32) ; - Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 - 70) "Combo" 20 ; + Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2) "Combo" 20 ; set_color (rgb 0 255 32) ; - Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(5+1)*10/7) (Csts.__height__/2 - 70) !Csts.combo 20 ; + Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(5+1)*10/7) (Csts.__height__/2) !Csts.combo 20 ; set_color (rgb 192 0 0) ; - Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 - 140) "Misses" 20 ; + Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 - 70) "Misses" 20 ; set_color (rgb 255 0 0) ; - Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(6+1)*10/7) (Csts.__height__/2 - 140) !Csts.misses 20 ; + Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(6+1)*10/7) (Csts.__height__/2 - 70) !Csts.misses 20 ; + + set_color (rgb 0 0 192) ; + Drawing.draw_string (Csts.__width__/6) (Csts.__height__/2 - 140) "Accuracy" 20 ; + set_color (rgb 0 0 192) ; + Drawing.draw_integer_alignedleft (Csts.__width__/6+20*(8+1)*10/7) (Csts.__height__/2 - 140) (int_of_float (1000. *. (float_of_int (!Csts.n_ans - !Csts.misses)) /. (float_of_int !Csts.n_ans))) 20 ; if !Csts.misses = 0 then begin set_color (rgb 0 255 0) ; diff --git a/maeth.o b/maeth.o index 856c3d8..1be0379 100644 Binary files a/maeth.o and b/maeth.o differ diff --git a/main.cmi b/main.cmi index fb2a3bc..4608bfb 100644 Binary files a/main.cmi and b/main.cmi differ diff --git a/main.cmx b/main.cmx index 0ff8e0d..7d0d850 100644 Binary files a/main.cmx and b/main.cmx differ diff --git a/main.ml b/main.ml index 7579f44..46a520e 100644 --- a/main.ml +++ b/main.ml @@ -19,6 +19,7 @@ let rec mainloop () = Csts.time_to_ans_f := float_of_int (!Csts.time_to_ans) ; Csts.total_time_f := float_of_int (!Csts.total_time) ; Csts.start_0 := Unix.gettimeofday () ; + Csts.n_ans := 0 ; Csts.max_score := 100 * !Csts.difficulty diff --git a/main.o b/main.o index bb93342..c62d8f5 100644 Binary files a/main.o and b/main.o differ diff --git a/math b/math index f5d3b76..9ed457e 100755 Binary files a/math and b/math differ diff --git a/math.cmx b/math.cmx index b3e722d..77500d6 100644 Binary files a/math.cmx and b/math.cmx differ diff --git a/math.o b/math.o index 37803bb..09c2fc0 100644 Binary files a/math.o and b/math.o differ diff --git a/menus.cmi b/menus.cmi index 6830628..69d9e7e 100644 Binary files a/menus.cmi and b/menus.cmi differ diff --git a/menus.cmx b/menus.cmx index 9301f40..1c82b9d 100644 Binary files a/menus.cmx and b/menus.cmx differ diff --git a/menus.o b/menus.o index 7f4504d..4513222 100644 Binary files a/menus.o and b/menus.o differ