(load "connect4") (load "a4code") (define (ref-c4-eval board current-player max-player) (let ((winner (c4-end? board)) (opponent (other-player max-player))) (cond ((equal? winner max-player) 1000) ((equal? winner (other-player max-player)) -1000) ((equal? winner 'draw) 0) (else (let ((max-r (open-rows board max-player)) (min-r (open-rows board opponent))) (apply + (append (map * '(1 2) (apply map + max-r)) (map * '(-1 -2) (apply map + min-r)))))))))