I found this forum post and while the code runs it does not seem to execute the getch function as keyboard input does not seem to be being handled properly.
Code: Select all
(ql:quickload "cl-charms")
(defconstant +map+ #2A(
("#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#")
("#" " " " " " " " " " " " " "#" " " " " " " " " " " " " "#")
("#" " " " " " " " " " " " " " " " " " " " " " " " " " " "#")
("#" " " " " " " " " " " " " "#" "#" "#" " " "#" "#" "#" "#")
("#" "#" "#" "#" " " "#" "#" "#" " " " " " " "#" " " " " "#")
("#" " " " " " " " " " " " " " " " " " " " " "#" " " " " "#")
("#" " " " " " " " " " " " " " " " " " " " " "#" " " " " "#")
("#" " " " " " " " " " " " " " " " " " " " " " " " " " " "#")
("#" " " " " " " " " " " " " " " " " " " " " "#" " " " " "#")
("#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#" "#")))
(defun move ()
(cl-charms:keypad (cl-charms:initscr) 1)
(cl-charms:curs-set 0)
(let ((y 1) (x 1) c)
(loop while (not (eq c 113)) do
;; printing map
(loop for yy from 0 to 9 do
(loop for xx from 0 to 14 do
(cl-charms:mvaddstr yy xx (aref +map+ yy xx))))
(if (and (eq c 107) (equal (aref +map+ (1- y) x) " "))
(incf y -1))
(if (and (eq c 106) (equal (aref +map+ (1+ y) x) " "))
(incf y))
(if (and (eq c 104) (equal (aref +map+ y (1- x)) " "))
(incf x -1))
(if (and (eq c 108) (equal (aref +map+ y (1+ x)) " "))
(incf x))
(if (and (eq c 98) (equal (aref +map+ (1+ y) (1- x)) " "))
(progn (incf y) (incf x -1)))
(if (and (eq c 121) (equal (aref +map+ (1- y) (1- x)) " "))
(progn (incf y -1) (incf x -1)))
(if (and (eq c 117) (equal (aref +map+ (1- y) (1+ x)) " "))
(progn (incf y -1) (incf x)))
(if (and (eq c 110) (equal (aref +map+ (1+ y) (1+ x)) " "))
(progn (incf y) (incf x)))
(cl-charms:mvaddstr y x "@")
(setf c (cl-charms:getch))))
(cl-charms:endwin))
(defun main ()
(move)
(exit))
Thanks for the advice, I loaded cl-charms. The libary loads - but there is no documentation on how to test it or make sure its working properly. The example files do not run. Like a lot of the libaries there is next to no documenation or support. I am starting to see some of the problems with using lisp..

I know its probably somthing wrong with my system but whos to know...
*update*
I found one example of cl-charms and it appears to work just fine. mmmmmm will need to have a play and perhaps document it.
Code: Select all
(defun clock ()
(charms:initscr)
(charms:clear)
(charms:curs-set 0)
(loop with start = (get-universal-time)
do (multiple-value-bind (s m h) (get-decoded-time)
(charms:mvaddstr 10 35 (format nil "~2,'0d:~2,'0d:~2,'0d" h m s)))
(charms:refresh)
until (>= (- (get-universal-time) start) 10))
(charms:endwin))
There were some pretty good curses and ncurses tutorials for python and c... will see how easy it is to port them.
Is there any kind of examples of using the simple built-in interface?