procgen  bot-cs.scm at [93b72b5a88]

File lib/bot-cs.scm artifact aad6714882 part of check-in 93b72b5a88


(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))))