Author Topic: LISP Challenge: Red Sector A  (Read 5019 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: LISP Challenge: Red Sector A
« Reply #15 on: December 11, 2008, 11:22:35 AM »
Here is mine.  Didn't look because I didn't want to write with a tainted mind, but it is pretty close to what is already here, if not exact.  But a fun little exercise.

Code: [Select]
(defun FindSector ( rad sec / Sector)
   
    (setq Sector (/ rad (/ (* 2 pi) sec)))
    (if (equal (rem Sector 1) 0.0 0.000001)
        Sector
        (+ 0.5 (fix Sector))
    )
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: LISP Challenge: Red Sector A
« Reply #16 on: December 11, 2008, 11:27:12 AM »
Here is mine ...

Hi, My 2 cents ...

Thanks guys. Kinda scary how we all think along the same lines but implement slightly different. Thanks for sharing your interpretations of a solution. :)

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

deegeecees

  • Guest
Re: LISP Challenge: Red Sector A
« Reply #17 on: December 11, 2008, 11:33:13 AM »
Code: [Select]
(defun ragged_grey ()
   (if liberators
      (setq feel '(hope))
      (setq feel '(fear))
   )
)

Please disregard preceding post.

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2149
  • class keyThumper<T>:ILazy<T>
Re: LISP Challenge: Red Sector A
« Reply #18 on: December 11, 2008, 04:53:18 PM »

I shouldn't write post code in haste  ... didn't even make my variables local.

on another issue : is nice to read a thread without social comment splattered throughout.




edit : oops, I just made a social comment.
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: LISP Challenge: Red Sector A
« Reply #19 on: December 11, 2008, 04:56:00 PM »

... didn't even make my variables local.

Like you said, you knocked it out quick, I wasn't going to nit pick something you'd fix as soon as you returned to the thread.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: LISP Challenge: Red Sector A
« Reply #20 on: December 11, 2008, 05:25:53 PM »
Code: [Select]
(defun ragged_grey ()
   (if liberators
      (setq feel '(hope))
      (setq feel '(fear))
   )
)

Please disregard preceding post.

Close:

Code: [Select]
(setq feel
   (if liberators
      '(hope)
      '(fear)
   )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst