Aller au contenu

ElpanovEvgeniy

Membres
  • Compteur de contenus

    151
  • Inscription

  • Dernière visite

Tout ce qui a été posté par ElpanovEvgeniy

  1. (defun test (a s) (defun f (a s i) (if i (cons i (f a s (VL-STRING-SEARCH a s (1+ i)))) ) ) (f a (apply 'strcat s) (vl-position a s))) (test "a"(list "a" "b" "c" "d" "e" "c" "a" "a" "a" "a" "c"))
  2. maybe? (vl-string-translate "\r\n " ")(_" str)
  3. other way: (defun texte_clipboard (/ HTML STR) (setq html (vlax-create-object "htmlfile") str (vlax-invoke (vlax-get (vlax-get html 'parentwindow) 'clipboarddata) 'getdata "text") ) (vlax-release-object html) (read (strcat "((" (vl-string-translate "\r\n" ")(" str) "))")))
  4. my version: (defun f (i l) (cond ((not l) (f i '(1 0))) ((< i 3) (+ (car l) (cadr l))) ((f (1- i) (list (+ (car l) (cadr l)) (car l)))) ) ) (mapcar '(lambda (a) (f a nil)) '(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21)) ;; (1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946) code uses a line calculation Not: (f n-1) + (f n-2) as (gile) Récursion terminale
  5. (defun f (l) ;;by ElpanovEvgeniy ;;(f '(a b a c b a c c a a)) ;;((A . 5) (B . 2) (C . 3)) (mapcar (function (lambda (a) (cons a (length (vl-remove-if-not (function (lambda (B) (equal a B))) l))))) (acet-list-remove-duplicates l nil) ))
  6. Yes, I wrote a few minutes...
  7. my version: (defun f (a B) (cond ((equal a B)) ((not (= (length a) (length B))) nil) ((f (vl-remove (car a) a) (vl-remove (car a) B))) ) )
  8. Salut, Je suis heureux que vous avez apprécié mon approche de la programmation!
  9. placer ici: (princ (entget(car(entsel"\n sélectionner 3d Face: "))))
  10. Vous posez des questions sur Civil 3D ou AutoCAD? Je voulais savoir, vous spécifiez deux objet 3dfase ou est un objet ayant 4 sommets? en: You ask about Civil 3d or Autocad? I wanted to know, you specify two 3dfase object or one object having 4 different points? ps. this google translate :(
  11. Salut! nommer les styles, les attributs, les attributs de titre, des textes, des textes à l'intérieur dimensions ?
  12. Salut Rien de nouveau. (defun test (s) (defun f (s a c) (if (wcmatch s (strcat "*" (chr a) "*")) (if c (substr s 1 (vl-string-position a s nil T)) (substr s (+ 2 (vl-string-position a s nil T))) ) s ) ) (f (f (f s 46 t) 92 nil) 47 nil))
  13. Je pense qu'il est intéressant d'essayer une longue liste de: test1 (setq new '(1 2 3 4) old '(4 3 2 1) lst '(3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 ) ) test2 (setq new '(q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o p q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o p q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o ) old '(3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 ) lst '(1 2 3 4) ) test3 (setq new '(q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o p q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o p q w e r y u i o p a s d f g h j k l z x c v b n m q w e r y u i o ) old '(3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 ) lst '(3 1 4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0 2 8 8 4 1 9 7 1 6 9 3 9 9 3 7 5 1 0 5 8 2 0 9 7 4 9 4 4 5 9 2 3 0 7 8 1 6 4 0 6 2 8 6 2 0 8 9 9 8 6 2 8 0 3 4 8 2 5 3 4 2 1 1 7 0 6 7 9 ) )
  14. as Patrick_35 (defun f (n o l / i) (setq i (length n)) (mapcar (function (lambda (a / B) (if (and (setq b (vl-position a o)) (< b i)) (nth b n) a ) ) ) l ) )
  15. Merci, (gile)! La nouvelle version: (defun f (n o l) (setq n (mapcar (function cons) o n)) (mapcar (function (lambda (a / B) (cond ((setq b (assoc a n)) (cdr B)) (a) ) ) ) l ) )
  16. Bonjour, ma version: (defun ee:f (n o l) (setq n (mapcar (function cons) o n)) (mapcar (function (lambda (a) (cond ((cdr (assoc a n))) (a) ) ) ) l ) )
  17. Merci! :) J'adore ces discussions. J'ai hâte aux premières décisions...
  18. recursion: (defun p->lst (a / i) (if (wcmatch a "*\\*") (cons (substr a 1 (setq i (vl-string-position 92 a))) (p->lst (substr a (+ i 2)))) (list a) ) ) (defun comp (a b) (if (and a b (= (strcase (car a) t) (strcase (car b) t))) (comp (cdr a) (cdr b)) (list a b) ) ) (defun test (a b) (setq a (comp (p->lst a) (p->lst b))) (if (= (caar a) (caadr a)) (apply 'strcat (append (cond ((not (car a)) '(".\\")) ((mapcar '(lambda (a) "..\\") (car a))) ) (mapcar '(lambda (a) (strcat a "\\")) (cadr a)) ) ) b ) )
  19. last version: (defun test (a b / i) (setq a (vl-string-right-trim "\\" (strcase a t)) b (vl-string-right-trim "\\" (strcase b t)) ) ;_ setq (cond ((/= (substr a 1 3) (substr b 1 3)) b) ((wcmatch b (strcat a "\\*")) (strcat "." (substr b (1+ (strlen a))))) (t (while (= (substr a 1 (setq i (vl-string-position 92 a))) (substr b 1 (vl-string-position 92 b)) ) ;_ = (setq a (substr a (+ i 2)) b (substr b (+ i 2)) ) ;_ setq ) ;_ while (While a (setq b (strcat "..\\" b) a (if (setq i (vl-string-position 92 a)) (substr a (+ i 2)) ) ;_ if ) ;_ setq ) ;_ While b ) ) ;_ cond ) [Edité le 1/2/2010 par ElpanovEvgeniy]
  20. vérifier (setq a "C:\\Doc\\Toto\\Temp" b "c:\\doc\\toto\\test\\blah\\fichier" )
  21. no recursion: (defun test (a b / i) ;;(test a b) (setq a (strcase a t) b (strcase b t) ) (cond ((/= (substr a 1 3) (substr b 1 3)) b) ((wcmatch b (strcat a "*")) (strcat "." (substr b (1+ (strlen a))))) (t (while (= (substr a 1 (setq i (vl-string-position 92 a))) (substr b 1 i)) (setq a (substr a (+ i 2)) b (substr b (+ i 2)) ) ) (While a (setq b (strcat "..\\" b) a (if (setq i (vl-string-position 92 a)) (substr a (+ i 2)) ) ) ) b ) ) )
  22. J'ai décidé que la récursivité ne contribue pas à moi de faire une plus courte ou plus simple - besoin de faire plusieurs programmes et les lier ... ps. Désolé, je trouve qu'il est difficile d'attraper la plaisanterie.
  23. Ah bon ? Tu es malade ? :cool: no! no recursion (rus >> fr) "sans récursion" без рекурсии
  24. Si vous avez besoin de plus de temps, je peux attendre. J'ai un code simple, sans récurrence, en utilisant des variables supplémentaires ... Je pense que vous pouvez facilement faire tous!
  25. Toutes les salutations! Dans cette rubrique sans réponses... Puis-je présenter ma version du programme ou de la peine d'attendre?
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer. Politique de confidentialité