src/generation.lisp @ 901e9fc8958d

Add simple Sketch viz
author Steve Losh <steve@stevelosh.com>
date Sun, 22 May 2016 22:02:25 +0000
parents e63077fb7d6a
children 155ad4c670c8
(in-package #:mazes.generation)

(defgenerator binary-tree-generator (grid)
  (grid-loop-cells cell grid
    (let ((other (random-elt (full-list (cell-north cell)
                                        (cell-east cell)))))
      (when other
        (cell-link cell other)))
    (yield)))

(defun binary-tree (grid)
  (do-generator (_ (binary-tree-generator grid))))