;; The first three lines of this file were inserted by DrRacket. They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-advanced-reader.ss" "lang")((modname entiers) (read-case-sensitive #t) (teachpacks ((lib "valrose.rkt" "installed-teachpacks"))) (htdp-settings #(#t write mixed-fraction #t #t none #f ((lib "valrose.rkt" "installed-teachpacks"))))) ;;; ;;; entiers.rkt ;;; Teachpack : valrose.rkt - Langage : Etudiant avance (define (entiers-v1 n x) (build-list n (lambda (i) (+ x i)))) (check-expect (entiers-v1 5 3) '(3 4 5 6 7)) (define (entiers-v2 n x) (if (= n 0) empty (cons x (entiers-v2 (- n 1) (+ x 1))))) (check-expect (entiers-v2 5 3) '(3 4 5 6 7))