Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

repetition

Name: Anonymous 2008-09-29 13:09

print "dongs" five times in your favorite language

with extreme conciseness/verbosity

Name: Anonymous 2008-09-30 3:08

(define (enumerate current high comparator incrementor mapper results)
  (cond ((comparator current high)
         (enumerate (incrementor current) high comparator incrementor mapper (append results (list (mapper current)))))
        (else results)))

(define (repeat something n)
  (enumerate 0 n (lambda (x y) (< x y)) (lambda (x) (+ 1 x)) (lambda (x) something) '()))

(define (repeat-dongs n)
  (repeat 'dongs n))

(define (five-dongs)
  (repeat-dongs 5))

(display (five-dongs))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List