Author Topic: do these challenges seem interesting to you?  (Read 388 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Bull Frog
  • Posts: 390
do these challenges seem interesting to you?
« on: March 03, 2022, 01:36:05 PM »
do these challenges seem interesting to you?

(REMOVE-NTH-IF x-nth x-lst x-function )
(SUBST-NTH-IF new x-nth x-lst x-function )
(INSERT-AFTER-NTH-IF new x-nth x-lst x-function )
(INSERT-BEFORE-NTH-IF new x-nth x-lst x-function )

JohnK

  • Administrator
  • Seagull
  • Posts: 10140
Re: do these challenges seem interesting to you?
« Reply #1 on: March 03, 2022, 02:17:12 PM »
Remove nth was done in A27.
We did do "Add nth" in A26 however, we did not do "Add-nth-if". Let me think about that one.
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org

domenicomaria

  • Bull Frog
  • Posts: 390
Re: do these challenges seem interesting to you?
« Reply #2 on: March 04, 2022, 01:37:01 AM »
I had already seen the delete-nth-if and add-nth functions

but I thought it might be interesting to put together
the following functions
delete-nth-if (or remove-nth-if)
add-nth-if (or insert-nth-if) with an option (add before or after nth)
subst-nth-if
because they are very similar and could be developed using the same method.

Also I think it would be interesting to always develop 2 types of solutions:
using only AUTO-LISP
or
using VISUAL-LISP as well

And it would also be useful to compare results and efficiency.

JohnK

  • Administrator
  • Seagull
  • Posts: 10140
Re: do these challenges seem interesting to you?
« Reply #3 on: March 04, 2022, 10:33:20 AM »
I have said this before but you are more than welcome to do the challenges in VisualLisp if that more in your comfort level but you should know that you will not employ the same programming process/procedures/etc as you would using a "simpler (-i.e. with not as many built-in tools)" language. Please, feel free to participate!

The "insert-after..." and "insert-before..." would be done by first finding the index of an item you want (which we have created several type of indexers) and using the "add-nth" type functions to add/delete an item. We can make a challenge like this but I think people will just copy and paste.
TheSwamp.org (serving the CAD community since 2003)

Donate to TheSwamp.org