28 lines
875 B
Plaintext
28 lines
875 B
Plaintext
;; The first three lines of this file were inserted by DrScheme. They record metadata
|
|
;; about the language level of this file in a form that our tools can easily process.
|
|
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname template-palindrome) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
|
|
;;
|
|
;;
|
|
;;
|
|
;;
|
|
(define (palindrome alox) ...)
|
|
|
|
;; Tests
|
|
(check-expect (palindrome (list 'a 'b 'c 'd))
|
|
(list 'a 'b 'c 'd 'c 'b 'a))
|
|
(check-expect (palindrome empty) empty)
|
|
(check-expect (palindrome (list 1 2 3 4)) (list 1 2 3 4 3 2 1))
|
|
|
|
;;
|
|
;;
|
|
;;
|
|
;;
|
|
(define (doubled-palindrome alox) ...)
|
|
|
|
;; Tests
|
|
(check-expect (doubled-palindrome (list 'a 'b ))
|
|
'(a a b b a a))
|
|
(check-expect (doubled-palindrome empty) empty)
|
|
(check-expect (doubled-palindrome (list 1 2 3))
|
|
(list 1 1 2 2 3 3 2 2 1 1))
|