Parser, runner and visualiser now work with string prog names.
[jars.git] / run-mars.scm
index 1d04af8..30b9e5c 100644 (file)
              (colors-left colors))
     (if (null? progs-left)
         entries
-        (let ((this-prog (car progs-left))
-              (this-col (car colors-left)))
-          (loop (cons (cons (prog-name this-prog) this-col) entries)
-                (cdr progs-left)
-                (cdr colors-left))))))
+        (if (null? colors-left)
+            (error "Not enough colours in colour map!")
+            (let ((this-prog (car progs-left))
+                  (this-col (car colors-left)))
+              (loop (cons (cons (prog-name this-prog) this-col) entries)
+                    (cdr progs-left)
+                    (cdr colors-left)))))))
 
 (define (mars-runner files iters core-size visualization)
   (print "Iters: " iters ", core size: " core-size)