picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 794346444a969b27735e58dfbfdc96a93bfd767f
parent e38dd31880928a82e647a4d681b336a7cf4aefbe
Author: Alexander Burger <abu@software-lab.de>
Date:   Wed, 20 Mar 2013 15:38:52 +0100

Cleaned up rcsim/ (removed simul/lib.l and simul/rgb.l)
Diffstat:
Mersatz/picolisp.jar | 0
Mrcsim/lib.l | 49+++++++++++++++++++++++++++++++++++++++++++++----
Dsimul/lib.l | 90-------------------------------------------------------------------------------
Dsimul/rgb.l | 29-----------------------------
Msrc/vers.h | 2+-
Msrc64/version.l | 4++--
6 files changed, 48 insertions(+), 126 deletions(-)

diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/rcsim/lib.l b/rcsim/lib.l @@ -1,11 +1,50 @@ -# 26aug09abu +# 20mar13abu # (c) Software Lab. Alexander Burger # *Pilot *Scene *Model # *DT *Thr *Speed *Climb *Alt -(load "simul/lib.l") +(scl 6) # Keep in sync with `SCL' in "src/z3d.c" +# Color Constant Definitions from "/usr/lib/X11/rgb.txt" +(de rgb (R G B . S) + (def S (+ B (* G 256) (* R 65536))) ) + +(rgb 0 0 0 . Black) +(rgb 0 0 255 . Blue) +(rgb 165 42 42 . Brown) +(rgb 0 100 0 . DarkGreen) +(rgb 169 169 169 . DarkGrey) +(rgb 190 190 190 . Grey) +(rgb 173 216 230 . LightBlue) +(rgb 255 0 0 . Red) +(rgb 255 255 0 . Yellow) + +(rgb 255 255 255 . White) + + +# Create model +(de model (Obj Lst) + (let X Obj + (while (sym? (cadr Lst)) + (setq X (get X (pop 'Lst))) ) + (unless X + (quit "Can't attach (sub)model" (car Lst)) ) + (prog1 + (put X (pop 'Lst) (box)) + (set @ + (conc + (cut 3 'Lst) + (cons + 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 + (mapcar + '((M) + (if (and (car M) (sym? (car M))) + (model Obj M) + M ) ) + Lst ) ) ) ) ) ) ) + +# Simulation (de *DT . 0.020) (de *Tower . 12.0) @@ -63,8 +102,10 @@ (=: vx (=: vy (=: vz 0))) (=: fx (=: fy (=: fz 0))) (=: dx (=: dy (=: dz 0))) - (z3d:dx -100.0 (: body)) - (z3d:dy -200.0 (: body)) + (set (: body 0) + (- (: body 0 1) 100.0) ) + (set (: body 0 -1) + (- (: body 0 2) 200.0) ) (blade> This) ) (dm dir> () diff --git a/simul/lib.l b/simul/lib.l @@ -1,90 +0,0 @@ -# 18mar10abu -# (c) Software Lab. Alexander Burger - -(scl 6) # Keep in sync with `SCL' in "src/z3d.c" - -(load "lib/simul.l") -(load "simul/rgb.l") - -# Unity Matrix -(setq - *UMat (1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0) - PI 3.1415927 - PI/2 1.5707963 ) - -# Mirror in y-direction -(de y-mirror (Lst) - (make - (while (sym? (car Lst)) - (link (pop 'Lst)) ) - (link - (pop 'Lst) # pos-x - (- (pop 'Lst)) # pos-y - (pop 'Lst) ) # pos-z - (for L Lst - (link - (if (sym? (car L)) - (y-mirror L) - (make - (link (cadr L) (car L)) - (when (sym? (car (setq L (cddr L)))) - (link (pop 'L)) ) - (while L - (link (pop 'L) (- (pop 'L)) (pop 'L)) ) ) ) ) ) ) ) - -# Create model -(de model (Obj Lst) - (let X Obj - (while (sym? (cadr Lst)) - (setq X (get X (pop 'Lst))) ) - (unless X - (quit "Can't attach (sub)model" (car Lst)) ) - (prog1 - (put X (pop 'Lst) (new (ext? Obj))) - (set @ - (make - (link (pop 'Lst) (pop 'Lst) (pop 'Lst)) - (mapc link *UMat) - (for M Lst - (link - (if (and (car M) (sym? (car M))) - (model Obj M) - M ) ) ) ) ) ) ) ) - -# Duplicate position and orientation -(de placement (Sym) - (prog1 - (new (ext? Sym)) - (set @ - (conc - (head 12 (val Sym)) - (mapcan - '((X) - (and - (sym? X) - (list (placement X)) ) ) - (nth (val Sym) 13) ) ) ) ) ) - -# Reset orientation -(de straight (M) - (touch M) - (map - '((V L) (set L (car V))) - *UMat - (cdddr (val M)) ) ) - -# Movements -(de z3d:dx (X M) - (touch M) - (set (val M) - (+ X (car (val M))) ) ) - -(de z3d:dy (Y M) - (touch M) - (set (cdr (val M)) - (+ Y (cadr (val M))) ) ) - -(de z3d:dz (Z M) - (touch M) - (set (cddr (val M)) - (+ Z (caddr (val M))) ) ) diff --git a/simul/rgb.l b/simul/rgb.l @@ -1,29 +0,0 @@ -# 02sep99abu -# (c) Software Lab. Alexander Burger - -(de rgb (R G B . S) - (def S (+ B (* G 256) (* R 65536))) ) - -# Color Constant Definitions from "/usr/lib/X11/rgb.txt" -(rgb 0 0 0 . Black) -(rgb 0 0 255 . Blue) -(rgb 165 42 42 . Brown) -(rgb 0 100 0 . DarkGreen) -(rgb 169 169 169 . DarkGrey) -(rgb 190 190 190 . Grey) -(rgb 173 216 230 . LightBlue) -(rgb 211 211 211 . LightGrey) -(rgb 255 0 0 . Red) -(rgb 46 139 87 . SeaGreen) -(rgb 255 255 0 . Yellow) - -(rgb 255 193 193 . RosyBrown1) -(rgb 238 180 180 . RosyBrown2) -(rgb 205 155 155 . RosyBrown3) -(rgb 139 105 105 . RosyBrown4) - -(rgb 221 160 221 . Plum) -(rgb 135 206 250 . LightSkyBlue) -(rgb 245 222 179 . Wheat) -(rgb 255 255 255 . White) -(rgb 139 0 0 . DarkRed) diff --git a/src/vers.h b/src/vers.h @@ -1 +1 @@ -static byte Version[4] = {3,1,1,17}; +static byte Version[4] = {3,1,1,18}; diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 14mar13abu +# 20mar13abu # (c) Software Lab. Alexander Burger -(de *Version 3 1 1 17) +(de *Version 3 1 1 18) # vi:et:ts=3:sw=3