In article <······················@pd7tw2no>,
Martin DeMello <·············@yahoo.com> wrote:
> (defun permute (i j l)
> (let ((temp (mapcar #'(lambda (x) (get-at i j x)) l)))
> (mapc #'(lambda (k v) (set-at i j k v)) l temp)))
It looks to me like you're just putting the values in TEMP back in the
same places you got them from. If you want to permute, shouldn't there
be some difference in the arguments you pass to SET-AT than GET-AT?
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Martin DeMello <·············@yahoo.com> writes:
> (defun permute (i j l)
> (let ((temp (mapcar #'(lambda (x) (get-at i j x)) l)))
> (mapc #'(lambda (k v) (set-at i j k v)) l temp)))
As far as I can tell, this first reads values from *LINE*, at
the offsets given in the list L, measured from (I, J); and then
writes the values back to their original locations.
Perhaps either the reading or writing phase should use an
increasing list (1 2 3 4) instead of L. Which one you choose
controls whether (2 4 1 3) is a clockwise or counterclockwise
rotation.
Kalle Olavi Niemitalo <···@iki.fi> wrote:
> Martin DeMello <·············@yahoo.com> writes:
>
> > (defun permute (i j l)
> > (let ((temp (mapcar #'(lambda (x) (get-at i j x)) l)))
> > (mapc #'(lambda (k v) (set-at i j k v)) l temp)))
>
> As far as I can tell, this first reads values from *LINE*, at
> the offsets given in the list L, measured from (I, J); and then
> writes the values back to their original locations.
Doh! Stupid mistake indeed - thanks.
martin