Faffing around with KOTH.
authorplugd <plugd@thelambdalab.xyz>
Mon, 25 Nov 2019 17:40:05 +0000 (18:40 +0100)
committerplugd <plugd@thelambdalab.xyz>
Mon, 25 Nov 2019 17:40:05 +0000 (18:40 +0100)
koth.scm

index 1ca77c3..b688f73 100644 (file)
--- 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)
 
 ;;;; 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
     (((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