
(integer->char -20)
(integer->char 270)

(char->integer #\N)
(char->integer #\+)
(char->integer #\#)

(define table
  (lambda (n)
    (if (< n 128)
        (begin
          (display n) (display " ")
          (display (integer->char n)) (display " ")
          (display (char->integer (integer->char n)))
          (newline)
          (table (+ n 1))))))

(table 32)

(list->string '())
(list->string '(#\a #\b #\c))
(list->string '(#\a #\b . #\c))

(define test1
  (lambda (n)
    (let ((str
           (list->string
            (map
             (lambda (pos)
               (integer->char
                (+ (char->integer #\A) pos -1)))
             (reverse (list-n n))))))
      (map
       (lambda (pos)
         (string-ref str (- pos 1)))
       (reverse (list-n n))))))

(test1 5)
(test1 10)
(test1 20)

(define randletters
  (lambda (n)
    (if (zero? n) '()
        (cons
         (integer->char
          (+ (char->integer #\A) (random 26)))
         (randletters (- n 1))))))

(define test2
 (lambda (len)
   (let* ((r (randletters len))
          (s (list->string r)))
     (display r) (display " ")
     (display s) (display " ")
     (display (string->list s)) (newline))))

(test2 5)
(test2 10)
(test2 20)

(string-append)
(apply string-append 
 (map symbol->string '(one two three four five)))
(make-string 0)

(string->list (make-string 5))
(string->list (make-string 15))

(define test3
  (lambda (len)
    (if (zero? len) ""
        (string-append
         (make-string len)
         (make-string
          len
          (integer->char
           (+ (char->integer #\a) len -1)))
         (test3 (- len 1))))))

(test3 1)
(test3 5)
(test3 7)


(number->string 123.456e7)
(number->string 678.456)
(map number->string (list-n 30))

(define test4
  (lambda (base)
    (map
     (lambda (n)
       (number->string n base))
     (reverse (list-n 30)))))

(test4 2)
(test4 3)
(test4 8)
(test4 10)
(test4 12)
(test4 16)

(define test5
  (lambda (base)
    (map
     (lambda (n)
       (number->string (+ (- n) 1) base))
     (reverse (list-n 30)))))

(test5 2)
(test5 3)
(test5 8)
(test5 10)
(test5 12)
(test5 16)


