From: nothing
Subject: Re: A* implementation
Date: 
Message-ID: <48cee3df-67d8-4309-ab49-238880c7b2fe@c1g2000yqg.googlegroups.com>
On Nov 26, 8:31 pm, Kaz Kylheku <········@gmail.com> wrote:
> On 2008-11-25, nothing <···············@gmail.com> wrote:
>
> >  BTW, since this is my first post in this group i ask you what you
> > consider the best websites for a newbie to learn lisp.
>
> Your school has a strange course schedule, doesn't it?  It's a bit unusual to
> be receiving a new project in late November, which requires you to start
> learning a whole new programming language.  Hmmm!

 In Portugal is this way. We start the school early/mid October and
finishes in february. The biggest problem here is not the schedule,
but the lack of teachers who can explain well a programming language
that is different from all the ones we learnt before. But it's not the
end of the world.

 I will not post here the project for one reason: i do not want the
solution for the problem, but the 'tools' to achieve it. And now, my
main difficulty is to put in lisp the A* search algorithm. And getting
lisp inside my head too.

 Thanks for all the answers.

From: Slobodan Blazeski
Subject: Re: A* implementation
Date: 
Message-ID: <a9f19b7e-6870-421c-a867-0be09da5d675@w35g2000yqm.googlegroups.com>
On Nov 27, 10:28 am, nothing <···············@gmail.com> wrote:
> On Nov 26, 8:31 pm, Kaz Kylheku <········@gmail.com> wrote:
>
> > On 2008-11-25, nothing <···············@gmail.com> wrote:
>
> > >  BTW, since this is my first post in this group i ask you what you
> > > consider the best websites for a newbie to learn lisp.
>
> > Your school has a strange course schedule, doesn't it?  It's a bit unusual to
> > be receiving a new project in late November, which requires you to start
> > learning a whole new programming language.  Hmmm!
>
>  In Portugal is this way. We start the school early/mid October and
> finishes in february. The biggest problem here is not the schedule,
> but the lack of teachers who can explain well a programming language
> that is different from all the ones we learnt before. But it's not the
> end of the world.
>
>  I will not post here the project for one reason: i do not want the
> solution for the problem, but the 'tools' to achieve it. And now, my
> main difficulty is to put in lisp the A* search algorithm. And getting
> lisp inside my head too.
>
>  Thanks for all the answers.

Than you have to learn lisp first. Got yourself nice book: If you're
beginner at programming or just want slower pace
http://www.cs.cmu.edu/~dst/LispBook/index.html or if you already know
how to program well http://gigamonkeys.com/book/ . Download IDE
http://phil.nullable.eu/ and start learning.
bobi
From: Pascal J. Bourguignon
Subject: Re: A* implementation
Date: 
Message-ID: <7ck5ap1ogy.fsf@pbourguignon.anevia.com>
nothing <···············@gmail.com> writes:

> On Nov 26, 8:31�pm, Kaz Kylheku <········@gmail.com> wrote:
>> On 2008-11-25, nothing <···············@gmail.com> wrote:
>>
>> > �BTW, since this is my first post in this group i ask you what you
>> > consider the best websites for a newbie to learn lisp.
>>
>> Your school has a strange course schedule, doesn't it? �It's a bit unusual to
>> be receiving a new project in late November, which requires you to start
>> learning a whole new programming language. �Hmmm!
>
>  In Portugal is this way. We start the school early/mid October and
> finishes in february. The biggest problem here is not the schedule,
> but the lack of teachers who can explain well a programming language
> that is different from all the ones we learnt before. But it's not the
> end of the world.
>
>  I will not post here the project for one reason: i do not want the
> solution for the problem, but the 'tools' to achieve it. And now, my
> main difficulty is to put in lisp the A* search algorithm. And getting
> lisp inside my head too.
>
>  Thanks for all the answers.

Common Lisp is multi-paradigm, so you should be able to implement any
algorithm directly in CL.  It may not be pretty, but it should work.

Of course, what you want to do, is to understand the algorithm well
enough, to be able to abstract its essence from the (generally)
low-level pseudo-language in which it is described, and rewrite it in
high level lisp style.



For example, you could have an algorithm such as:

For average, taking a vector a, and n, the number of element in a, do:
    i:=0
    s:=0
    while i<n
       s:=s+a[i]
       i:=i+1
    result is s/n


You may write in lisp (*):

(defun average (a n)
  (let ((i 0)
        (s 0)) 
    (loop while (< i n)
          do (setf s (+ s (aref a i))
                   i (+ i 1)))
    (/ s n)))

or you could understand what you're doing, and rewrite it in lisp:

(defun average (a)
   (/ (reduce (function +) a) (length a)))


Some people write books full of algorithms written even in assembler
as pseudo-language...  From a theorical point of view, it's not a bad
idea, but in practice if you have to implement these algorithms in a
high level programming language, you'd better understand them and
reimplement them.



There are even algorithms given with pseudo-code full of gotos!  You
can still use TAGBODY and GO to transcribe them in lisp.

-- 
__Pascal Bourguignon__