358eb20e7967

Update flax API
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 14 Mar 2018 22:56:46 -0400
parents ad6e9787c073
children 859d1588e6ab
branches/tags (none)
files src/robots/bit-loom.lisp

Changes

--- a/src/robots/bit-loom.lisp	Tue Mar 06 22:47:04 2018 -0500
+++ b/src/robots/bit-loom.lisp	Wed Mar 14 22:56:46 2018 -0400
@@ -29,10 +29,15 @@
               "pure"))))
 
 (defun loom-5 (seed)
-  (let* ((points (* 100 (random-range-inclusive 1 100)))
-         (generator (flax.looms.005-simple-triangulations::loom
-                      seed points "out" :png 1000 1000)))
-    (format nil "~R points, ~A generator" points generator)))
+  (let ((points (* 100 (random-range-inclusive 1 100))))
+    (destructuring-bind (generator ratio)
+        (flax.looms.005-simple-triangulations::loom
+          seed points "out" :png 1000 1000)
+      (format nil "~R points, ~A generator, ~A triangulation"
+              points generator
+              (if (= 1 ratio)
+                "full"
+                (format nil "~R percent" (truncate (* 100 ratio))))))))
 
 
 (chancery:define-rule (select-loom :distribution :weighted)