The Lambda Lab
/
projects
/
jars.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1ec9960
)
Faffing around with KOTH.
author
plugd
<plugd@thelambdalab.xyz>
Mon, 25 Nov 2019 17:40:05 +0000
(18:40 +0100)
committer
plugd
<plugd@thelambdalab.xyz>
Mon, 25 Nov 2019 17:40:05 +0000
(18:40 +0100)
koth.scm
patch
|
blob
|
history
diff --git
a/koth.scm
b/koth.scm
index
1ca77c3
..
b688f73
100644
(file)
--- a/
koth.scm
+++ b/
koth.scm
@@
-6,8
+6,6
@@
matchable
mars parser)
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)
(define INITIAL-INSTR (make-instr 'DAT 'F 'immediate 0 'immediate 0))
(define (file->prog file)
@@
-65,12
+63,26
@@
;;;; Main ;;;;
;;;; 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")
(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 "
\n
Usage:\t" binary " hill-directory challenger-file")
(print "\t" binary " [-h|--help]")
(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
(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)
(((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)
(((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
((hill-dir challenger-file)
(print "Not implemented"))
(else