aboutsummaryrefslogtreecommitdiff
path: root/morpion_rec
diff options
context:
space:
mode:
Diffstat (limited to 'morpion_rec')
-rw-r--r--morpion_rec/FeirisuNyanNyan/_tags2
-rw-r--r--morpion_rec/FeirisuNyanNyan/feirisu.ml17
l---------morpion_rec/FeirisuNyanNyan/lib1
-rw-r--r--morpion_rec/Mayushii/_tags2
l---------morpion_rec/Mayushii/lib1
-rw-r--r--morpion_rec/Mayushii/mayushii.ml14
-rw-r--r--morpion_rec/NiAh/main.c5
7 files changed, 42 insertions, 0 deletions
diff --git a/morpion_rec/FeirisuNyanNyan/_tags b/morpion_rec/FeirisuNyanNyan/_tags
new file mode 100644
index 0000000..c653205
--- /dev/null
+++ b/morpion_rec/FeirisuNyanNyan/_tags
@@ -0,0 +1,2 @@
+"lib": include
+true: use_unix, use_graphics
diff --git a/morpion_rec/FeirisuNyanNyan/feirisu.ml b/morpion_rec/FeirisuNyanNyan/feirisu.ml
new file mode 100644
index 0000000..be6cc63
--- /dev/null
+++ b/morpion_rec/FeirisuNyanNyan/feirisu.ml
@@ -0,0 +1,17 @@
+
+module Mayushii : Player.IA = struct
+
+ module G = Morpion_rec.G
+
+ let play g =
+ let cc = G.possibilities g in
+ List.nth cc
+ (Random.int (List.length cc))
+
+end
+
+module P = Player.P(Mayushii)
+
+let () =
+ Random.self_init();
+ P.run()
diff --git a/morpion_rec/FeirisuNyanNyan/lib b/morpion_rec/FeirisuNyanNyan/lib
new file mode 120000
index 0000000..e834a2a
--- /dev/null
+++ b/morpion_rec/FeirisuNyanNyan/lib
@@ -0,0 +1 @@
+../../judge \ No newline at end of file
diff --git a/morpion_rec/Mayushii/_tags b/morpion_rec/Mayushii/_tags
new file mode 100644
index 0000000..c653205
--- /dev/null
+++ b/morpion_rec/Mayushii/_tags
@@ -0,0 +1,2 @@
+"lib": include
+true: use_unix, use_graphics
diff --git a/morpion_rec/Mayushii/lib b/morpion_rec/Mayushii/lib
new file mode 120000
index 0000000..e834a2a
--- /dev/null
+++ b/morpion_rec/Mayushii/lib
@@ -0,0 +1 @@
+../../judge \ No newline at end of file
diff --git a/morpion_rec/Mayushii/mayushii.ml b/morpion_rec/Mayushii/mayushii.ml
new file mode 100644
index 0000000..57ec3aa
--- /dev/null
+++ b/morpion_rec/Mayushii/mayushii.ml
@@ -0,0 +1,14 @@
+
+module Mayushii : Player.IA = struct
+
+ module G = Morpion_rec.G
+
+ let play g =
+ let cc = G.possibilities g in
+ List.hd cc
+
+end
+
+module P = Player.P(Mayushii)
+
+let () = P.run()
diff --git a/morpion_rec/NiAh/main.c b/morpion_rec/NiAh/main.c
index 1cee771..7447085 100644
--- a/morpion_rec/NiAh/main.c
+++ b/morpion_rec/NiAh/main.c
@@ -46,10 +46,12 @@ int main()
if(strcmp(input, "Hello morpion_rec") == 0)
{
printf("Hello morpion_rec\n");
+ fflush(stdout);
}
else
{
printf("Who are you, crazy bastard?\n");
+ fflush(stdout);
return EXIT_FAILURE;
}
@@ -95,6 +97,7 @@ int main()
if(strstr(input,"You win")==input || strstr(input,"You lose")==input || strstr(input,"Tie")==input || strstr(input,"Cheater")==input)
{
printf("Fair enough\n");
+ fflush(stdout);
return EXIT_SUCCESS;
}
}
@@ -115,11 +118,13 @@ int main()
play(grid, subgrid, move, CROSS);
updateWon(grid, &won, swon, subgrid, move);
printf("Play %d %d %d %d\n", subgrid%3+1, subgrid/3+1, move%3+1, move/3+1);
+ fflush(stdout);
subgrid=move;
printGrid(grid, swon);
if(won==CROSS)
fprintf(stderr, "I won !!");
+ fflush(stdout);
}
return EXIT_SUCCESS;