Skip to content

Commit b47b5c8

Browse files
author
Theo Cliquot
committed
ALL
0 parents  commit b47b5c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+979
-0
lines changed

.config_emacs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
(load "quack.el")
2+
(require (quote quack))
3+
(custom-set-variables
4+
;; custom-set-variables was added by Custom.
5+
;; If you edit it by hand, you could mess it up, so be careful.
6+
;; Your init file should contain only one such instance.
7+
;; If there is more than one, they won't work right.
8+
'(case-fold-search t)
9+
'(current-language-environment "UTF-8")
10+
'(default-input-method "rfc1345")
11+
'(inhibit-startup-screen t)
12+
'(show-paren-delay 0)
13+
'(show-paren-mode t)
14+
'(show-paren-style (quote expression))
15+
'(transient-mark-mode t)
16+
'(auto-compression-mode t nil (jka-compr))
17+
'(case-fold-search t)
18+
'(current-language-environment "UTF-8")
19+
'(default-input-method "rfc1345")
20+
'(global-font-lock-mode t nil (font-lock))
21+
22+
'(quack-browse-url-browser-function (quote browse-url-mozilla))
23+
'(quack-default-program "mit-scheme")
24+
;; '(quack-fontify-style (quote emacs))
25+
;; '(quack-newline-behavior (quote indent-newline-indent))
26+
;; '(quack-pretty-lambda-p nil)
27+
'(quack-smart-open-paren-p t)
28+
'(quack-switch-to-scheme-method (quote own-frame))
29+
'(diff-switches "-u")
30+
'(inhibit-startup-screen t)
31+
)
32+
(custom-set-faces
33+
;; custom-set-faces was added by Custom.
34+
;; If you edit it by hand, you could mess it up, so be careful.
35+
;; Your init file should contain only one such instance.
36+
;; If there is more than one, they won't work right.
37+
)
38+

annale/exo2.scm

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
(define evPol (lambda (P x)
2+
(if (null? (cdr P))
3+
(car P)
4+
(+ (* x (evPol (cdr P) x)) (car p))
5+
)
6+
))
7+
8+
(evPol '(0 0 -1 2 3) 4)
9+
10+
(define fp (lambda (P)
11+
(lambda (x) (evPol P x))))
12+
13+
((fp '(0 0 -1 2 3)) 4)
14+
15+
(define somPol
16+
(lambda (P1 P2)
17+
(map + P1 P2)))
18+
19+
(somPol `(0 1 2 3 4) `(4 3 2 1 0))
20+
21+
(define multxPol
22+
(lambda (P)
23+
(append `(0) P)))
24+
25+
(multxPol `(1 2 3))
26+
27+
(define miroir
28+
(lambda (l)
29+
(if (null? (cdr L))
30+
L
31+
(append (miroir (cdr L)) (list(car L))))
32+
)
33+
)
34+
35+
(define prefixe
36+
(lambda (L)
37+
(if (null? L)
38+
L
39+
(cons (list (car L)) (map (lambda (x) (cons (car L) x)) (prefixe (cdr
40+
L)))))))
41+
42+
(prefixe '(A B C))
43+
44+
(define plsc
45+
(lambda (L)
46+
))

tp1/*Backtrace*

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Debugger entered--Lisp error: (void-function define)
2+
(define carre (function (lambda (L) (if (null\? L) (quote nil) (append (* (car L) (car L)) (cdr L))))))
3+
eval((define carre (function (lambda (L) (if (null\? L) (quote nil) (append (* (car L) (car L)) (cdr L)))))) nil)
4+
elisp--eval-last-sexp(nil)
5+
eval-last-sexp(nil)
6+
funcall-interactively(eval-last-sexp nil)
7+
call-interactively(eval-last-sexp nil nil)
8+
command-execute(eval-last-sexp)

tp1/..config_emacs.un~

1.92 KB
Binary file not shown.

tp1/.carre.sch.un~

23.6 KB
Binary file not shown.

tp1/.config_emacs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
(load "quack.el")
2+
(require (quote quack))
3+
(custom-set-variables
4+
;; custom-set-variables was added by Custom.
5+
;; If you edit it by hand, you could mess it up, so be careful.
6+
;; Your init file should contain only one such instance.
7+
;; If there is more than one, they won't work right.
8+
'(case-fold-search t)
9+
'(current-language-environment "UTF-8")
10+
'(default-input-method "rfc1345")
11+
'(inhibit-startup-screen t)
12+
'(show-paren-delay 0)
13+
'(show-paren-mode t)
14+
'(show-paren-style (quote expression))
15+
'(transient-mark-mode t)
16+
'(auto-compression-mode t nil (jka-compr))
17+
'(case-fold-search t)
18+
'(current-language-environment "UTF-8")
19+
'(default-input-method "rfc1345")
20+
'(global-font-lock-mode t nil (font-lock))
21+
22+
'(quack-browse-url-browser-function (quote browse-url-mozilla))
23+
'(quack-default-program "mit-scheme")
24+
;; '(quack-fontify-style (quote emacs))
25+
;; '(quack-newline-behavior (quote indent-newline-indent))
26+
;; '(quack-pretty-lambda-p nil)
27+
'(quack-smart-open-paren-p t)
28+
'(quack-switch-to-scheme-method (quote own-frame))
29+
'(diff-switches "-u")
30+
'(inhibit-startup-screen t)
31+
)
32+
(custom-set-faces
33+
;; custom-set-faces was added by Custom.
34+
;; If you edit it by hand, you could mess it up, so be careful.
35+
;; Your init file should contain only one such instance.
36+
;; If there is more than one, they won't work right.
37+
)
38+

tp1/.config_emacs~

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
(load "quack.el")
2+
(require (quote quack))
3+
(custom-set-variables
4+
;; custom-set-variables was added by Custom.
5+
;; If you edit it by hand, you could mess it up, so be careful.
6+
;; Your init file should contain only one such instance.
7+
;; If there is more than one, they won't work right.
8+
'(case-fold-search t)
9+
'(current-language-environment "UTF-8")
10+
'(default-input-method "rfc1345")
11+
'(inhibit-startup-screen t)
12+
'(show-paren-delay 0)
13+
'(show-paren-mode t)
14+
'(show-paren-style (quote expression))
15+
'(transient-mark-mode t)
16+
'(auto-compression-mode t nil (jka-compr))
17+
'(case-fold-search t)
18+
'(current-language-environment "UTF-8")
19+
'(default-input-method "rfc1345")
20+
'(global-font-lock-mode t nil (font-lock))
21+
22+
'(quack-browse-url-browser-function (quote browse-url-mozilla))
23+
'(quack-default-program "mit-scheme")
24+
;; '(quack-fontify-style (quote emacs))
25+
;; '(quack-newline-behavior (quote indent-newline-indent))
26+
;; '(quack-pretty-lambda-p nil)
27+
'(quack-smart-open-paren-p t)
28+
'(quack-switch-to-scheme-method (quote own-frame))
29+
'(diff-switches "-u")
30+
'(inhibit-startup-screen t)
31+
)
32+
(custom-set-faces
33+
;; custom-set-faces was added by Custom.
34+
;; If you edit it by hand, you could mess it up, so be careful.
35+
;; Your init file should contain only one such instance.
36+
;; If there is more than one, they won't work right.
37+
)
38+

tp1/carre.sch

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(define carre
2+
(lambda (L)
3+
(if (null? L)
4+
'()
5+
(cons (* (car L) (car L)) (carre (cdr L))))))
6+
7+
(carre '(1 2 3 4 5)

tp1/carre.scm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(define carre
2+
(lambda (l)
3+
(if (null? (cdr l))
4+
(list (* (car l) (car l)))
5+
(cons (* (car l) (car l)) (carre (cdr l)))
6+
)
7+
)
8+
)
9+
10+
(carre '(1 2 3 4 5))

tp1/circle.scm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
(define PI 3.1415)
2+
3+
(define circle_perim
4+
(lambda (r)
5+
(list (* 2 (* PI r)))
6+
)
7+
)
8+
9+
(define circle_aire
10+
(lambda (r)
11+
(list (* r (* PI r)))
12+
)
13+
)
14+
15+
16+
(define circle
17+
(lambda (r)
18+
(append (circle_perim r) (circle_aire r))
19+
)
20+
)
21+
22+
(circle 2)

tp1/epure.scm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(define membre
2+
(lambda (x L)
3+
(if(null? L)
4+
#f
5+
(if(= (car L) x)
6+
#t
7+
(membre x (cdr L))))))
8+
9+
10+
(define epure
11+
(lambda (L)
12+
(if (null? L)
13+
'()
14+
(if (membre (car L) (cdr L))
15+
(epure (cdr L))
16+
(cons (car L) (epure(cdr L)))))))
17+
18+
(display (epure '(4 5 5 2 4 5 2 6 2 2)))

tp1/fac.scm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(define fac
2+
(lambda (x)
3+
(if (= x 0)
4+
1
5+
(* x (fac (- x 1)))
6+
)
7+
)
8+
)
9+
10+
(fac 4)

tp1/fibo.scm

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(define fibo_rec_term
2+
(lambda (x u1 u2)
3+
(if (<= x 1)
4+
u2
5+
(fibo_rec_term (- x 1) u2 (+ u1 u2))
6+
)
7+
)
8+
)
9+
10+
11+
12+
(define fibo
13+
(lambda (x)
14+
(if (= x 0)
15+
0
16+
(fibo_rec_term (- x 1) 1 1))
17+
)
18+
)
19+
20+
(fibo 10)

tp1/ies.scm

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(define ies
2+
(lambda (L n)
3+
(if (null? L)
4+
'(()()())
5+
(let ((result (ies (cdr L) n)))
6+
(if (< (car L) n)
7+
(list (cons (car L) (car result)) (cadr result) (caddr result))
8+
(if (> (car L) n)
9+
(list (car result) (cadr result) (cons (car L) (caddr result)))
10+
(list (car result) (cons (car L) (cadr result)) (caddr result))
11+
)
12+
)
13+
)
14+
)
15+
)
16+
)
17+
18+
(ies '(1 2 3 4 5 6 7 6 5 4 3 2 1) 5)
19+

tp1/insere.scm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(define insere
2+
(lambda (n x L)
3+
(if (and (null? L) (> n 0))
4+
L
5+
(if (= n 0)
6+
(cons x L)
7+
(cons (car L) (insere (- n 1) x (cdr L)))))))
8+
9+
(insere 2 2 '(0 1 3 4))
10+
(insere 10 999 '(0 1 2 3 4))

tp1/inter.scm

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
(define membre
2+
(lambda (x L)
3+
(if(null? L)
4+
#f
5+
(if(= (car L) x)
6+
#t
7+
(membre x (cdr L))))))
8+
9+
(define inter
10+
(lambda (L1 L2)
11+
(if (null? L1)
12+
'()
13+
(if (membre (car L1) L2)
14+
(cons (car L1) (inter (cdr L1) L2))
15+
(inter (cdr L1) L2)))))
16+
17+
(inter '( 1 2 3 4 5 6 2) '(0 2 4 6))

tp1/long.scm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(define long
2+
(lambda (L)
3+
(if (null? L)
4+
0
5+
(+ 1 (long (cdr L)))
6+
)
7+
)
8+
)
9+
10+
(long '(1 2 3 4 5 6 7 8 9))

tp1/membre.scm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(define membre
2+
(lambda (x L)
3+
(if(null? L)
4+
#f
5+
(if(= (car L) x)
6+
#t
7+
(membre x (cdr L))))))
8+
9+
(membre 3 '(4 5 4 5 10 33))

tp1/miroir.scm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(define miroir
2+
(lambda (l)
3+
(if (null? (cdr L))
4+
L
5+
(append (miroir (cdr L)) (list(car L))))
6+
)
7+
)
8+
9+
(miroir '(1 2 3 4 5))

tp1/moy.scm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
(define (sum_len L)
2+
(if (null? L)
3+
'(0 0)
4+
(let ((result (sum_len (cdr L))))
5+
(list (+ (car L) (car result)) (+ 1 (cadr result)))
6+
)
7+
)
8+
)
9+
10+
11+
(define moy
12+
(lambda (L)
13+
(let ((result (sum_len L)))
14+
(/(car result) (cadr result))
15+
)))
16+
17+
(sum_len '(1 2 3 4))
18+
(moy '(1 2 3 4 5))

tp1/nbpos.scm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(define nbpos
2+
(lambda (L)
3+
(if(null? L)
4+
0
5+
(if (>= (car L) 0)
6+
(+ 1 (nbpos (cdr L)))
7+
(nbpos (cdr L))))))
8+
9+
(nbpos '(-1 -2 5 10 -3 4))

tp1/nieme.scm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(define nieme
2+
(lambda (x L)
3+
(if (= x 0)
4+
(car L)
5+
(nieme(- x 1) (cdr L)))))
6+
7+
(nieme 5 '(0 1 2 3 4 5))

tp1/niv0.scm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(define niv0
2+
(lambda (L)
3+
(if(null? L)
4+
'()
5+
(if (list? (car L))
6+
(append (niv0(car L)) (niv0 (cdr L)))
7+
(cons (car L) (niv0 (cdr L))))
8+
9+
)))
10+
(niv0 '(0 (((1) 2) 3) (4 5) 6))

0 commit comments

Comments
 (0)