Bladeren bron

Random commit i can't remember

Matt Coles 10 jaren geleden
bovenliggende
commit
fdb922d0f3
1 gewijzigde bestanden met toevoegingen van 12 en 3 verwijderingen
  1. 12 3
      poly.cl

+ 12 - 3
poly.cl

@@ -1,6 +1,5 @@
1 1
 (defun poly+ (poly1 poly2)
2
-  (format t "Poly One: ~d~%" poly1)
3
-  (format t "Poly Two: ~d~%" poly2))
2
+  (add-terms poly1 poly2))
4 3
 
5 4
 (defun find-variable-symbol (single-poly)
6 5
   (car (car (car single-poly))))
@@ -11,5 +10,15 @@
11 10
 (defun find-multiplier (single-poly)
12 11
   (cdr (car single-poly)))
13 12
 
13
+(defun is-single-poly (var-poly)
14
+  (if (equal (length var-poly) 1) T nil))
15
+
16
+(defun add-terms (poly1 poly2)
17
+  (if (equal (is-single-poly poly1) (is-single-poly poly2))
18
+  (cons poly1 poly2)
19
+  (progn
20
+    )
21
+  ))
22
+
14 23
 (poly+ '(((x 2) 3)) '(((y 2) 4)))
15
-(poly+ '(((x 2) 3) ((y 2) 3)) '(((y 2) 4)))
24
+; (poly+ '(((x 2) 3) ((y 2) 3)) '(((y 2) 4)))