about summary refs log tree commit diff stats
path: root/sim.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'sim.lsp')
-rw-r--r--sim.lsp11
1 files changed, 11 insertions, 0 deletions
diff --git a/sim.lsp b/sim.lsp
new file mode 100644
index 0000000..80d6f0d
--- /dev/null
+++ b/sim.lsp
@@ -0,0 +1,11 @@
+;; TODO: air resistance, terminal velocity
+(defconstant +G+ 9.81)
+(defglobal *alt* 20000)
+(defglobal *v* 0)
+(defun step ()
+   (setq *alt* (- *alt* *v*))
+   (setq *v* (+ *v* +G+))
+   (format (standard-output) "~A~%" *alt*))
+(defun main ()
+   (while (> *alt* 0)
+	  (step)))