aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHVukman <peterslopp@googlemail.com>2025-08-09 14:36:49 +0200
committerGitHub <noreply@github.com>2025-08-09 14:36:49 +0200
commitd82f2717f86d5e3044508dcd38059ef9f9674daf (patch)
tree60c265d13f66bb978ba576bd0201e7f0993cb8bd
parent3de48fb7d924191619907307a35a4aee89441c49 (diff)
downloadperlweeklychallenge-club-d82f2717f86d5e3044508dcd38059ef9f9674daf.tar.gz
perlweeklychallenge-club-d82f2717f86d5e3044508dcd38059ef9f9674daf.tar.bz2
perlweeklychallenge-club-d82f2717f86d5e3044508dcd38059ef9f9674daf.zip
Create 333_p1.l
-rw-r--r--challenge-333/hvukman/picolisp/333_p1.l39
1 files changed, 39 insertions, 0 deletions
diff --git a/challenge-333/hvukman/picolisp/333_p1.l b/challenge-333/hvukman/picolisp/333_p1.l
new file mode 100644
index 0000000000..d8b55fc403
--- /dev/null
+++ b/challenge-333/hvukman/picolisp/333_p1.l
@@ -0,0 +1,39 @@
+(de dummy (X)
+ (mapcar * X 100000)
+)
+
+(setq inp
+ (list (list (2 1) (2 3) (2 5) ) (list (1 4) (3 4) (10 4) )
+ (list (0 0) (1 1) (2 3) )
+ (list (1 1) (1 1) (1 1) )
+ (mapcar dummy (list (1 1) (2 2) (3 3) ))
+ )
+)
+
+## caluclated the determinant between line 1, line 2 and 1 1 1
+(de straight (X)
+(let
+ (P1 (get X 1) P2 (get X 2) P3 (get X 3)
+ x1 (get P1 1) x2 (get P2 1)
+ x3 (get P3 1)
+ y1 (get P1 2) y2 (get P2 2)
+ y3 (get P3 2)
+ )
+ (if (= 0
+ ( + (sum + (mapcar (quote (X) (apply * X ))
+ (list (list x1 y2 ) (list x2 y3 ) (list x3 y1 ))))
+ (sum - (mapcar (quote (X) (apply * X ))
+ (list (list x1 y3 ) (list x2 y1 ) (list x3 y2 )))))
+ )
+ (println 'true)
+ (println 'false)
+ )
+)
+)
+
+
+(for X inp
+ (straight X)
+)
+
+#(load "perlpico/333_p1.l")