diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-11-08 23:09:37 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-11-08 23:09:37 +0100 |
commit | e720e1dfcddd8eb38fa562cc197b39f14d2fa7a5 (patch) | |
tree | e9d605979cac1ddae50f77a130fa8abc0ab5e1f9 /juge/protocol.ml | |
parent | 1ae5103457a1d6694e68a8b0e5225cb348ebd978 (diff) | |
download | CompetIA-e720e1dfcddd8eb38fa562cc197b39f14d2fa7a5.tar.gz CompetIA-e720e1dfcddd8eb38fa562cc197b39f14d2fa7a5.zip |
Correct monstruous error.
Diffstat (limited to 'juge/protocol.ml')
-rw-r--r-- | juge/protocol.ml | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/juge/protocol.ml b/juge/protocol.ml deleted file mode 100644 index 3f6d548..0000000 --- a/juge/protocol.ml +++ /dev/null @@ -1,41 +0,0 @@ - -exception Invalid_message of string - -type msg = - | Hello of string (* nom du jeu *) - | YourTurn of float (* nombre secondes pour jouer *) - | Play of string (* description textuelle du coup *) - | OK (* coup accepté *) - | YouWin - | YouLose - | Tie - | Eliminated - | FairEnough - -let decode = function - | "OK" -> OK - | "You win" -> YouWin - | "You lose" -> YouLose - | "Tie" -> Tie - | "Eliminated" -> Eliminated - | "Fair enough" -> FairEnough - | s when String.sub s 0 6 = "Hello " -> - Hello (String.sub s 6 (String.length s - 6)) - | s when String.sub s 0 10 = "Your turn " -> - YourTurn (float_of_string (String.sub s 10 (String.length s - 10))) - | s when String.sub s 0 5 = "Play " -> - Play (String.sub s 5 (String.length s - 5)) - | s -> raise (Invalid_message s) - -let encode = function - | Hello x -> "Hello " ^ x - | YourTurn n -> "Your turn " ^ (string_of_float n) - | Play x -> "Play " ^ x - | OK -> "OK" - | YouWin -> "You win" - | YouLose -> "You lose" - | Tie -> "Tie" - | Eliminated -> "Eliminated" - | FairEnough -> "Fair enough" - - |