# HG changeset patch # User Steve Losh # Date 1519175989 18000 # Node ID 380f30d82a98b39d3c928793d336879d5700661e # Parent 2bf00f41a8b98bd898c9c05c83c75ef201dfc7dd Update bit loom diff -r 2bf00f41a8b9 -r 380f30d82a98 src/robots/bit-loom.lisp --- a/src/robots/bit-loom.lisp Thu Feb 15 00:09:28 2018 -0500 +++ b/src/robots/bit-loom.lisp Tue Feb 20 20:19:49 2018 -0500 @@ -21,17 +21,24 @@ (format nil "variety: anabaena catenula")) (defun loom-4 (seed) - (destructuring-bind (lsystem iterations) + (destructuring-bind (lsystem iterations mutagen) (flax.looms.004-turtle-curves::loom seed "out.png" 1000 1000) - (format nil "~R iterations of ~A" iterations lsystem))) + (format nil "~R iterations of ~A, ~A" iterations lsystem + (if mutagen + (format nil "mutagen ~D" mutagen) + "pure")))) + +(chancery:define-rule (select-loom :distribution :weighted) + (1.0 1) + (0.5 2) + (0.2 3) + (2.0 4)) (defparameter *looms* '(loom-1 loom-2 loom-3 loom-4)) (defun generate-image (seed &key force-loom) (let* ((loom-index (random (length *looms*))) - (loom-index (if force-loom - (1- force-loom) - loom-index)) + (loom-index (1- (or force-loom (select-loom)))) (loom (elt *looms* loom-index))) (format t "Running ~A~%" loom) (force-output)