Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type plate = int * int * int ;;
- type game_statu =
- Non_term of int
- |P1 of int
- |P2 of int
- |Match_nul of int;;
- let init a:plate =(0,a,a);;
- let display a:plate =
- match a with
- |(-1,p1,p2) -> (" ","X"," "," "," ")
- |(-0,p1,p2) -> (" "," ","X"," "," ")
- |(1,p1,p2) -> (" "," "," ","X"," ")
- |(a,p1,p2) when a < (-1) -> print_string "le joueur 1 a gagner"
- |(_,p1,p2) -> print_string "le joueur 2 a gagner"
- in
- print_string "le joueur 1 a:";
- print_int p1;
- print_newline();
- print_string "| "^c^" |";
- print_newline();
- print_string "| "^d^" |";
- print_newline();
- print_string "| "^e^" |";
- print_newline();
- print_string "le joueur 2 a"
- print_int p2;;
- display (0,20,50);;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement