;;; Fichier dessin.drs / 7 avril 1999 (define (trace-ligne l) (cond ((null? l) (newline)) ((> (car l) 1) (trace-ligne (cdr l))) (else (display (if (= (car l) 1) "*" " ")) (trace-ligne (cdr l))))) (define (affiche l1) (cond ((null? l1) (display "fin")) (else (trace-ligne (car l1)) (affiche (cdr l1))))) ;;; Chargement d'une image (matrice) dans le fichier bitmap.drs: ;;; (0 0 1 2 0 2 2) ;;; (1 0 0 0 1 0 2) etc. ;;; Chaque ligne entre parenthese ;;; Seuls les 0 et 1 donnent le dessin, les 2 sont du "bruit" (define (charge nom-fich) (boucle (open-input-file nom-fich))) (define (boucle port) (let ((x (read port))) (if (eof-object? x) () (cons x (boucle port))))) ;;; * ;;; **** * ;;; ***** * ;;; **** * ;;; *** ** ;;; ** *** ;;; ** *** ;;; ******* ;;; ******** ;;; ******* * ;;; ****** * ;;; ***** ***** ;;; **** *** * *** ;;; *** *** * **** ;;; ** ** * **** ;;; ** **** **** ;;; * * *** ;;; * * ** ;;; * * * ** ;;; * ;;; **** * ;;; ****** * ;;; **** *