aboutsummaryrefslogtreecommitdiffstats
path: root/ltg.ml
diff options
context:
space:
mode:
Diffstat (limited to 'ltg.ml')
-rw-r--r--ltg.ml13
1 files changed, 11 insertions, 2 deletions
diff --git a/ltg.ml b/ltg.ml
index e5de957..8aed118 100644
--- a/ltg.ml
+++ b/ltg.ml
@@ -1,3 +1,10 @@
+open Game
+
+let _ = if Array.length Sys.argv < 2 then begin
+ Printf.printf "You must specify the player number\n";
+ exit 1
+end
+
let me = int_of_string Sys.argv.(1)
let opponent = match me with
@@ -6,8 +13,10 @@ let opponent = match me with
| _ -> failwith "Wrong player_number"
let read_move () = Scanf.scanf "%d\n" (fun d -> match d with
- | 1 -> Scanf.scanf "%s\n%d\n" (fun s d -> ())
- | 2 -> Scanf.scanf "%d\n%s\n" (fun d s -> ())
+ | 1 -> Scanf.scanf "%s\n%d\n" (fun s d ->
+ Cards.left_apply opponent (card_of_string s) d)
+ | 2 -> Scanf.scanf "%d\n%s\n" (fun d s ->
+ Cards.right_apply opponent (card_of_string s) d)
| _ -> failwith "Wrong move number"
)