File: complexe0.ml

package info (click to toggle)
ocaml-doc 3.09-1
  • links: PTS
  • area: non-free
  • in suites: etch, etch-m68k
  • size: 10,428 kB
  • ctags: 4,963
  • sloc: ml: 9,244; makefile: 2,413; ansic: 122; sh: 49; asm: 17
file content (19 lines) | stat: -rw-r--r-- 354 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let c = ref 0

let ic = open_in "ebi"
let oc = open_out "ebo"


let parse_gui_message () =
  let s = input_line ic in
  match s with
  | "bouton" -> incr c; string_of_int !c
  | s -> "syntax error: " ^ s

let treat() =
  let answer = parse_gui_message() in
  output_string oc answer;
  output_char oc '\n';
  flush oc

let _ = while true do treat() done