printpot.lisp (584B)
1 ;; print potential 2 3 (unless (= (length *posix-argv*) 2) 4 (format t "usage: printpot filename~%") 5 (exit :code 1)) 6 7 (defun read-potential (pathname) 8 (with-standard-io-syntax 9 (with-open-file (s pathname) 10 (read s)))) 11 12 (defun print-potential (potential) 13 (loop 14 with w = (array-dimension potential 0) 15 with h = (array-dimension potential 1) 16 for j from (1- h) downto 0 17 do (loop 18 for i below w 19 do (format t "~6,3F~:[ ~;~%~]" 20 (aref potential i j) 21 (eql i (1- w)))))) 22 23 (print-potential (read-potential (pathname (second *posix-argv*))))