Author Topic: Result sort  (Read 2402 times)

0 Members and 1 Guest are viewing this topic.

xiaobizhang

  • Guest
Result sort
« on: July 25, 2015, 02:01:21 PM »
Code - Auto/Visual Lisp: [Select]
  1. ;;;known
  2. (setq l1'('(3 10) '(2 15) '(1 22))
  3.      l2 '('('(3) '(1))
  4.           '('(2 2))
  5.           '('(2) '(1 1))
  6.           '('(1 1 1 1))
  7.           '('(1 1 1)))
  8.       )
  9. ;;;Result
  10. (setq l3 '('('(3) '(1))  10)    ;According L2 ['('(3) '(1))]=>     '((3 10) (1 20)) [Because (gcd 10 20)=10] => '( '((3) (1))  10) and Surplus '(1 12)
  11.          '('('(2 2))  7)        ;According L2 ['('(2 2))]=>        '('(2 15)) => '( '('(2 2)) 7) and Surplus '(2 1)
  12.          '('('(2) '(1 1))  1)   ;According L2 ['('(2) '(1 1))]=>    Surplus '(2 1) + Surplus '(1 12) [Because (gcd 1 12)=1] => '('('(2) '(1 1))  1)  and Surplus '(1 10)
  13.          '('('(1 1 1 1)) 2)     ;According L2 ['('(1 1 1 1))]=>    '(1 10) => '('('(1 1 1 1)) 2) and Surplus '(1 2)
  14.          '('(1 1) 2)           ;According L2 ['('(1 1 1))]=>      '(1 2) => '('(1 1) 2)
  15.       )
  16.  

 
Sorry! I am anxious to go out, I made a mistake.
« Last Edit: July 26, 2015, 02:09:09 AM by xiaobizhang »

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Result sort-x-y
« Reply #1 on: July 25, 2015, 02:38:23 PM »
Is there a question in there somewhere?  :?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Result sort-x-y
« Reply #2 on: July 25, 2015, 02:40:44 PM »
Only yours.  :D
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst