;; A connect-five player that takes a long time to answer: ;; An on/off switch for any debugging statements. (define debugging-on false) (define program-name "slow.ss") ; used in debugging. ;; debug: string, strings... --> (void) ;; Print a message (via printf) to stderr, if debugging-on. ;; (We can't print to stdout -- the referee awaits an answer there.) ;; (define (debug msg . args) (when debugging-on (let* {[msg-w-src (string-append program-name " debug: " msg "~n")] [arg-list (cons msg-w-src args)] ; The list of arguments for printf. [full-msg-string (apply format arg-list)]} (fprintf (current-error-port) full-msg-string)))) ;; A player that takes a long time to answer: (define (coma _) (coma (sleep 60))) (coma 17)