diff --git a/src/propeller/genome.cljc b/src/propeller/genome.cljc index 5c12462..8d2bbed 100755 --- a/src/propeller/genome.cljc +++ b/src/propeller/genome.cljc @@ -12,7 +12,8 @@ (defn plushy->push "Returns the Push program expressed by the given plushy representation." [plushy argmap] - (let [opener? #(and (vector? %) (= (first %) 'open))] ;; [open ] marks opens + (let [plushy (if (:diploid argmap) (map first (partition 2 plushy)) plushy) + opener? #(and (vector? %) (= (first %) 'open))] ;; [open ] marks opens (loop [push () ;; iteratively build the Push program from the plushy plushy (mapcat #(if-let [n (get push/opens %)] [% ['open n]] [%]) plushy)] (if (empty? plushy) ;; maybe we're done?