Artifact aad67148824cce816a73c6cab2d96cf28bd63bc3290dc8ec29cc4df6acf50edd:
- File lib/bot-cs.scm — part of check-in [1521429541] at 2018-09-24 23:18:14 on branch trunk — initial commit (user: lexi, size: 451) [annotate] [blame] [check-ins using]
(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))))