#lang scheme/base (provide (all-defined-out)) (define (assoc-remove k l) (cond ((null? l) '()) ((eq? (car (car l)) k) (assoc-remove k (cdr l))) (else (cons (car l) (assoc-remove k (cdr l)))))) (define (choose l) (list-ref l (random (length l)))) (define (list-contains k l) (cond ((null? l) #f) ((eq? (car l) k) #t) (else (list-contains k (cdr l)))))