Search found 35 matches

by methusala
Mon Nov 16, 2009 11:07 am
Forum: Common Lisp
Topic: Keyboard/Mouse user inputs
Replies: 4
Views: 2255

Re: Keyboard/Mouse user inputs

First take a look at the gui libraries mentioned in the libs post. After that there is: http://www.franz.com/products/allegrocl/acl_gui_tools.lhtml http://www.lispworks.com/ http://www.ahklisp.com/ http://docs.plt-scheme.org/gui/index.html http://clojure.org/ -which can use java gui libraries using ...
by methusala
Fri Nov 13, 2009 5:43 pm
Forum: Common Lisp
Topic: Connect 4 in lisp
Replies: 2
Views: 2158

Connect 4 in lisp

Here's the beginning of a mini lisp practice project, connect 4. Feel free to chime in with code, critiques or other input. I would like to practice the coding approach of a dsl and simultaneous bottom up and top down, so to start here is some pseudo code: bottom up: (defun make-board () ) (defun pr...
by methusala
Fri Nov 13, 2009 1:50 pm
Forum: Common Lisp
Topic: Must Know Libs
Replies: 5
Views: 3185

Re: Must Know Libs

How about clim, hunchentoot and cl-ncurses. That way one can create gui's for the desktop, web and cli.

http://www.cliki.net/CLIM

http://common-lisp.net/project/cl-ncurses/

http://weitz.de/hunchentoot/
by methusala
Wed Nov 11, 2009 7:17 am
Forum: Common Lisp
Topic: Number of levels in a tree
Replies: 15
Views: 6754

Re: Number of levels in a tree

Look at the levelnum code and think about how to change it.
by methusala
Wed Nov 11, 2009 6:54 am
Forum: Common Lisp
Topic: how can I launching external programs?
Replies: 23
Views: 10866

Re: how can I launching external programs?

The svg file format is an xml script. Just replace the words 'hello out there' with whatever words you want to display, and open it with any browser except internet explorer. http://www.w3.org/TR/SVG11/text.html Lisp related books in German: http://books.google.com/books?ei=QMX6SoHvGsmCnQfy7qiADQ&ct...
by methusala
Tue Nov 10, 2009 12:50 pm
Forum: Common Lisp
Topic: Number of levels in a tree
Replies: 15
Views: 6754

Re: Number of levels in a tree

Congratulations on a valiant attempt that is almost there. Here are some observations: CL-USER> (nivel '((a) b c) 0) ; Evaluation aborted. CL-USER> -returned 'b is not of type list' CL-USER> (nivel '((a) (b) (c)) 0) 1 CL-USER> -function requires all root level leaves to be lists. CL-USER> (nivel '((...
by methusala
Tue Nov 10, 2009 11:28 am
Forum: Common Lisp
Topic: Number of levels in a tree
Replies: 15
Views: 6754

Re: Number of levels in a tree

If your function is recursive, walking both the car and cdr parts of a list, and uses > to decide which depth number to return (such as to a + function), than it will work on n-ary trees. If you post the function you wrote, I'll post one I wrote and we can comment on it. Car is the first item in a l...
by methusala
Mon Nov 09, 2009 9:08 pm
Forum: Common Lisp
Topic: how can I launching external programs?
Replies: 23
Views: 10866

Re: how can I launching external programs?

Here's another way to do it, create an svg image using something like this saved to an x.svg file, with the 'Hello out there' words replaced: (setf ss "<?xml version=\"1.0\" standalone=\"no\"?> <!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"> <sv...
by methusala
Mon Nov 09, 2009 8:58 pm
Forum: Common Lisp
Topic: Number of levels in a tree
Replies: 15
Views: 6754

Re: Number of levels in a tree

If you know how to obtain a certain number using a certain form, why do you need to set a variable to it?

If needed, post whatever code you have so far and perhaps more hints will be forthcoming.
by methusala
Sat Nov 07, 2009 10:28 pm
Forum: Common Lisp
Topic: Get last element of a list
Replies: 5
Views: 8015

Re: Get last element of a list

Code: Select all

(defun mylast(x)
       (if (and (listp x) (null (cdr x)) ) (car x)
       (mylast (cdr x))))

(defun eachlast(x)
        (if (null x) x
	    (progn      
 	    (cons (mylast (car x))
       	    (eachlast (cdr x))))))

CL-USER> (eachlast '((1 9 5)(3 3 3)(1 0 3 0 2)))
(5 3 2)