diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2011-06-18 21:20:38 -0400 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2011-06-18 21:20:38 -0400 |
| commit | f414fbe3f87d18496691c1071363040a59ff468f (patch) | |
| tree | b3562a4f579aa7fa0f01491c306b12b348557ef7 | |
| parent | 207459f2a8cb98603541c1698a89c0c77c83b1ea (diff) | |
| parent | 74a451bce4fc3106f908e933a564df055d11d1bd (diff) | |
| download | icfp2011-f414fbe3f87d18496691c1071363040a59ff468f.tar.gz | |
Merge branch 'master' of github.com:Zaran/icfp2011
| -rw-r--r-- | Makefile | 32 | ||||
| -rw-r--r-- | ltg.ml | 13 |
2 files changed, 43 insertions, 2 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..98262de --- /dev/null +++ b/Makefile @@ -0,0 +1,32 @@ +OCAMLC=ocamlc.opt +OCAMLOPT=ocamlopt.opt +OCAMLDEP=ocamldep.opt +INCLUDES= +OCAMLFLAGS=$(INCLUDES) +SRCS=game.ml ltg.ml +BUILDDIR= +DEPEND=.depend + +all: ltg.opt + +ltg.opt: ltg.cmx + $(OCAMLOPT) $(OCAMLFLAGS) -o ltg game.cmx ltg.cmx + +clean: + rm -f *.cm? *.cmx? *.o *~ + rm -f .depend + +depend: $(SRCS) + $(OCAMLDEP) $(SRCS) > $(DEPEND) + +.SUFFIXES: .mli .ml .cmo .cmi .cmx + +%.cmo : %.ml + $(OCAMLC) -c $(OCAMLFLAGS) $< +%.cmi : %.mli + $(OCAMLC) -c $(OCAMLFLAGS) $< +%.cmx : %.ml + $(OCAMLOPT) -c $(OCAMLFLAGS) $< + +-include $(DEPEND) + @@ -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" ) |
