X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=jars.git;a=blobdiff_plain;f=koth.scm;h=b688f7327ad8dbe14b34d9fe1706b2aea86a2cb5;hp=1ca77c31cf4a9c5d4b24ad2acd4e7ea138d59583;hb=92ceff30a0101ae772a5a469bcd1c85a44b861fc;hpb=7a4ae6a55e8bd93b9b08bbec346caad7b1c2e83d 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