procgen  Artifact [aad6714882]

Artifact aad67148824cce816a73c6cab2d96cf28bd63bc3290dc8ec29cc4df6acf50edd:


(define-macro (rule . body)
  (define (make-cases ct body acc)
    (if (eq? body '()) acc
      (make-cases (+ ct 1) (cdr body)
		(cons (list (list ct) (cons 'string-append (car body))) acc))))
  (list 'define (car body)
	(cons 'case (cons (list 'random (length (cdr body)))
	  (make-cases 0 (cdr body) '()) ))))

(define {list1}
	(case (random ct)
		((0) (string-append {list2}))
		))

(define (pick ar)
	(vector-ref ar (random (vector-length ar))))