Author Topic: Name the process :: Game 1  (Read 8057 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Name the process :: Game 1
« on: May 10, 2006, 08:45:08 AM »
The object of this game is to name the process you want done on this function. The first one to post, gets to name the overall process preformed. Then we have to build our procedures based on those instructions. For instance; here is a sample game played out.


*** POST 1

Given the list: (0 1 2 3 4 5 6 7 8 9)
I want to ___________.

*** POST 2

Return the list with he last item removed.

*** POST 3

(defun pop-last (l)
  (reverse (cdr (reverse l))) )


(Obviously, thats a very simple example, but im not going to build a complex example for something that im not entirely sure is going to 'fly'.) I think this game could be alot of fun because of the lack of direction (so to speak) You are free to do as you want without restraints.

So...

Given the list: (0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9)
I want to ___________.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

uncoolperson

  • Guest
Re: Name the process :: Game 1
« Reply #1 on: May 10, 2006, 10:11:33 AM »
dent it up real good?



list unique?
(create a list of lists of unique values from a list of not so unique values)



JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Name the process :: Game 1
« Reply #2 on: May 10, 2006, 11:49:13 AM »
What?!
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

uncoolperson

  • Guest
Re: Name the process :: Game 1
« Reply #3 on: May 10, 2006, 12:38:24 PM »
i did it once... and i forgot what i did to make it pretty...



turn a list like;
(1 2 3 4 5 4 4 2 1 3 6 7 4 6 9 6 5 1 3)

into
(( 1 2 3 4 5 6 7 9 ) ( 1 2 3 4 5 6 ) ( 1 3 4 6 ) ( 4 ))

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #4 on: May 11, 2006, 08:55:44 AM »
Code: [Select]
(defun for-theswamp (lst)
  (if lst
    ((lambda (x)
       (cons (vl-sort (car x) '<) (for-theswamp (cadr x)))
     ) ;_  lambda
      (for-theswamp-1 (cdr lst) (list (car lst)) nil)
    )
  ) ;_  if
) ;_  defun
(defun for-theswamp-1 (lst a1 a2)
  (if lst
    (if (member (car lst) a1)
      (for-theswamp-1 (cdr lst) a1 (cons (car lst) a2))
      (for-theswamp-1 (cdr lst) (cons (car lst) a1) a2)
    ) ;_  if
    (list a1 a2)
  ) ;_  if
) ;_  defun


(for-theswamp  '(1 2 3 4 5 4 4 2 1 3 6 7 4 6 9 6 5 1 3))
;; => '((1 2 3 4 5 6 7 9) (1 2 3 4 5 6) (1 3 4 6) (4))

uncoolperson

  • Guest
Re: Name the process :: Game 1
« Reply #5 on: May 11, 2006, 10:22:05 AM »
i thought i had killed this

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #6 on: May 11, 2006, 10:36:35 AM »
i thought i had killed this
I have not understood you...
I have written this program today.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Name the process :: Game 1
« Reply #7 on: May 11, 2006, 11:18:41 AM »
AS I understand uncoolperson comment, I think he was saying that he killed the thread due to the lack of activity.
I just think people are too busy to participate, anyway that's my excuse.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #8 on: May 11, 2006, 12:54:50 PM »
Thank for explanations Alan :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Name the process :: Game 1
« Reply #9 on: May 11, 2006, 01:06:07 PM »
You are welcome.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #10 on: May 11, 2006, 01:33:28 PM »
You are welcome.

If, my course...

Sort the list which is not using SETQ, VL-*
Code: [Select]
(setq lst '(7 3 4 6 9 6 7 2 5 3 2 3 6 4 6 3 1)
      f   (function <)
)
(defun sort (lst f)
  ?????
)
  :-)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Name the process :: Game 1
« Reply #11 on: May 11, 2006, 01:44:50 PM »
Code: [Select]
(defun sort (lst)
  (dos_sortlist lst)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #12 on: May 11, 2006, 01:47:29 PM »
Shortly, but for me does not work... :-(

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #13 on: May 11, 2006, 01:49:30 PM »
Code: [Select]
(defun sort (lst)
  (dos_sortlist lst)
)
For this program, it is necessary dos_lib?

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Name the process :: Game 1
« Reply #14 on: May 12, 2006, 01:42:52 PM »
Probably, I have not understood, game rules...
Where I can see or explain me.
Beforehand thank!