susu #6355(2008/05/27 08:38 GMT) [ OCaml ] Rating0/0=0.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#load "unix.cma";; open Unix;; (*エコー、行バッファoff*) let x = tcgetattr Unix.stdout in tcsetattr Unix.stdout TCSADRAIN {x with c_icanon = false; c_vmin = 1; c_echo = false; }; at_exit (fun () -> tcsetattr Unix.stdout TCSADRAIN x;); (*一秒ごとのa*) Sys.set_signal Sys.sigalrm (Sys.Signal_handle (fun _ -> print_char 'a'; flush Pervasives.stdout)); (*本編*) let t = ref (setitimer ITIMER_REAL {it_interval=1.0; it_value=1.0}) in while true do match input_char Pervasives.stdin with | 'q' -> exit 0 | 'p' -> t := setitimer ITIMER_REAL !t | _ -> () done;;
Rating0/0=0.00-0+
[ reply ]
susu
#6355()
[
OCaml
]
Rating0/0=0.00
Rating0/0=0.00-0+
[ reply ]