Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/24/2020 in all areas

  1. Quick example: (defun foo ( l f / r z ) (foreach x (reverse l) (if (vl-some '(lambda ( y ) (if (apply f (list x (car y))) (setq z y))) r) (setq r (subst (cons x z) z r)) (setq r (cons (list x) r)) ) ) ) _$ (setq attdata '((6 4 "A") (6 4 "B") (18 11 "A") (18 11 "A") (18 11 "C") (18 12 "C") (22 6 "T") (22 6 "M"))) ( ( 6 4 "A") ( 6 4 "B") (18 11 "A") (18 11 "A") (18 11 "C") (18 12 "C") (22 6 "T") (22 6 "M") ) _$ (foo attdata '(lambda ( a b ) (and (= (car a) (car b)) (= (cadr a) (cadr b))))) ( (( 6 4 "A") ( 6 4 "B")) ((18 11 "A") (18 11 "A") (18 11 "C")) ((18 12 "C")) ((22 6 "T") (22 6 "M")) )
    2 points
  2. You're most welcome @hosneyalaa
    1 point
  3. @ronjonp Small issue: (or (setq n (getint "\nNumber of offsets:<1>")) 1) I think this should be: (or (setq n (getint "\nNumber of offsets:<1>")) (setq n 1))
    1 point
  4. Another (Defun _Pair (lst / a f s g b nlst) ( (lambda (lst) (while (setq a (car lst)) (setq b nil f (car a) s (cadr a) g (list a)) (Foreach itm (Cdr lst) (if (and (= (Car itm) f)(= (Cadr itm) s)) (setq g (cons itm g)) (setq b (cons itm b)))) (setq nlst (cons g nlst) lst (reverse b)) ) nlst ) (reverse lst) ) )
    1 point
  5. @BIGAL With all the pictures intact you're introducing a missing (csv->lst) function and less functionality of a simple command line input which both accepts a picked distance or number? You really should validate user input before passing them along .. have you thought about that? .. Sorry you have many posts that seem to SPAM many good replies ( this one included ) ;/ FWIW less links to your AH:* functions and pictures and provide a complete solution. Most people cannot or will not assemble your puzzles.
    1 point
×
×
  • Create New...