From: plugd Date: Mon, 25 Nov 2019 17:40:05 +0000 (+0100) Subject: Faffing around with KOTH. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=92ceff30a0101ae772a5a469bcd1c85a44b861fc;p=jars.git Faffing around with KOTH. --- diff --git a/koth.scm b/koth.scm index 1ca77c3..b688f73 100644 --- a/koth.scm +++ b/koth.scm @@ -6,8 +6,6 @@ matchable mars parser) -(define CORE-SIZE 8000) -(define GAMES-PER-MATCH 1) (define INITIAL-INSTR (make-instr 'DAT 'F 'immediate 0 'immediate 0)) (define (file->prog file) @@ -65,12 +63,26 @@ ;;;; Main ;;;; +;; Default values + +(define default-core-size 8000) +(define default-game-length 80000) +(define default-games-per-match 1) +(define default-hill-size 10) + + + (define (print-usage) (let ((binary (pathname-file (car (argv))))) (print "King of the Hill Tournament Manager") - (print "Usage:\t" binary " hill-directory challenger-file") + (print "\nUsage:\t" binary " hill-directory challenger-file") (print "\t" binary " [-h|--help]") - (print "\t" binary " [-i|--init] hill-directory [hill-size [core-size game-length games-per-match]]"))) + (print "\t" binary " [-i|--init] hill-directory [hill-size [core-size game-length games-per-match]]") + (print "\nDefault values are as follows:\n" + "\thill-size: " default-hill-size "\n" + "\tcore-size: " default-core-size "\n" + "\tgame-length: " default-game-length "\n" + "\tgames-per-match: " default-games-per-match))) (define (process-args args) (match args @@ -79,9 +91,17 @@ (((or "-i" "--init") dir hill-size core-size game-length games-per-match) (init-hill-dir dir hill-size core-size game-length games-per-match)) (((or "-i" "--init") dir) - (init-hill-dir dir 10 8000 80000 10)) + (init-hill-dir dir + default-hill-size + default-core-size + default-game-length + default-games-per-match)) (((or "-i" "--init") dir hill-size) - (init-hill-dir dir hill-size 8000 80000 10)) + (init-hill-dir dir + hill-size + default-core-size + default-game-length + default-games-per-match)) ((hill-dir challenger-file) (print "Not implemented")) (else