dotsandboxes/arena.rkt

15 lines
644 B
Racket
Raw Normal View History

#lang racket
; runs all the players against each other as both first and second player.
(require "main.rkt" "players.rkt")
(define all-players (list player-random player-first player-last player-greedy player-nico player-generous))
(define matchups (append (combinations all-players 2) (map reverse (combinations all-players 2)) (for/list ([p all-players]) (list p p))))
(define (arena)
(define matches (for/list ([m matchups])
(start-game (first m) (second m) 6 6)))
(for ([m matches])
(save-game! m (format "/tmp/games/~a Vs ~a.dbn" (player-name (first (GameState-players m))) (player-name (second (GameState-players m)))))))