Skip to content

@samrat /gist:3844987
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
(define cutA 7)
(define growA 3)
(define cutB 5)
(define growB 2)
(define (attack-monster heads)
(use-sword heads 0 null))
(define (use-sword n grow s)
(cond ((< n 0) null)
((= n 0)
;(print s)
;(newline)
(if (empty? s)
null
s))
(else
(append
(list (use-sword
(- (+ n grow) cutA)
growA
(append s (list 'a))))
(list (use-sword
(- (+ n grow) cutB)
growB
(append s (list 'b))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.