;;; Your entry for the Scheme contest ;;; ;;; Title: ;;; "A Blur of Color" ;;; ;;; Description: ;;; Colors mix around ;;; You can't escape the chaos ;;; Refridgerator (define (partition total max-pieces max-value color-list) (define (helper lst total max-pieces max-value color-list) ( (penup) (pendown) (color (car color-list)) (cond ((= total 0) (list lst)) ((< total 0) '()) ((<= max-value 0) '()) ((= max-pieces 0) '()) (else ( (set-car! color-list (cadr coluor)) (set-cdr! color-list (list (cddr coluor) (car coluor))) (define colour (list (cadr color-list) (list (cddr color-list) (car color-list)))) (right (quotient 360 max-pieces)) (forward (* 20 max-value)) (append (helper (append lst (list max-value)) (- total max-value) (- max-pieces 1) max-value colour)(helper lst total max-pieces (- max-value 1) colour))))))) (helper '() total max-pieces max-value color-list)) (define colors (list (quote red) (list (quote orange) (list (quote yellow) (list (quote green) (list (quote blue) (list (quote purple)))))))) (partition 10 5 6 colors)