Author Topic: Question of the day #5  (Read 6071 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« on: December 01, 2004, 07:48:43 AM »
What does the following function calculate?
 
Code: [Select]

(defun func (a b c)
  (defun sq (n) (* n n))
  (/
    (-
      (+ (sq b) (sq c))
      (sq a)
      )
    (* 2 b c)
    )
  )

(func 85.0 100.0 80.0)
0.573438
TheSwamp.org  (serving the CAD community since 2003)

whdjr

  • Guest
Question of the day #5
« Reply #1 on: December 01, 2004, 09:44:30 AM »
You know we need to set up rules or guidlines for these questions.
Something kinda like:

1.  Please don't post your answer until 3 hours after the initial post.
     (So that everyone's answer is completely bias.  Also if I see someone
      else has already answered it I might not even try.)

2.  During this time frame someone could ask questions or you could
     give out hints or clues.

3.  People could also chime in with "I got my answer.  How about you guys?".


These are just a few thoughts to make this fun and good learning at the same
time.  If the answer is posted within 2 minutes of the original post newbies might get discouraged.

Just my thoughts so please don't beat them up too bad.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Question of the day #5
« Reply #2 on: December 01, 2004, 09:47:39 AM »
good idea
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

whdjr

  • Guest
Question of the day #5
« Reply #3 on: December 01, 2004, 10:33:09 AM »
You edited your post Kerry :D

Man, I'm stumped!?!?!?!?

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #4 on: December 01, 2004, 10:47:55 AM »
I agree, some guidelines would be a good. The problem is the time frame. If we make 3 hours then some one is going to get left out, and 24 hours may be to long. But I agree we to do something.

How does this sound?

Question of the day guidelines:
1. Please do not post your answer for 24 hours after the time of the post.
2. If you wish you may post something like "I've got it!"
3. Feel free to ask questions, or for hints.
4. Feel free to PM the person who asked the question.
5. Do not be embarrassed by your answer or code.
TheSwamp.org  (serving the CAD community since 2003)

CADaver

  • Guest
Re: Question of the day #5
« Reply #5 on: December 01, 2004, 10:52:03 AM »
Quote from: Mark Thomas
Code: [Select]

(defun func (a b c)
  (defun sq (n) (* n n))
  (/
    (-
      (+ (sq b) (sq c))
      (sq a)
      )
    (* 2 b c)
    )
  )

(func 85.0 100.0 80.0)
0.573438


Lesee, you're adding the squares of b and c, then subtracting the square of a.  Then you're dividing the whole mess by 2 times b times c.

Dunno man, looks sorta familiar, but I ain't gotta clue.

whdjr

  • Guest
Question of the day #5
« Reply #6 on: December 01, 2004, 10:52:36 AM »
Mark,

Those sound very good.  3 hours was just a time I used for illustration.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Question of the day #5
« Reply #7 on: December 01, 2004, 12:14:48 PM »
Well, like CADaver, it looks soooo familiar, but I just can't place it ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

dubb

  • Swamp Rat
  • Posts: 1105
Question of the day #5
« Reply #8 on: December 01, 2004, 12:19:55 PM »
no multiple choice?

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Question of the day #5
« Reply #9 on: December 01, 2004, 12:54:24 PM »
I think encrypted answers would be cool (that way the first person to have the correct answer "wins".). ...Once the time is up we just post our keys to decrypt the answers.

So that means no edited posts. (if they do edit the post we assume cheeting.)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

whdjr

  • Guest
Question of the day #5
« Reply #10 on: December 01, 2004, 01:00:05 PM »
Sounds great Se7en.

So whose got the encryption tool?  I know I had mine around here somewhere....?

CarlB

  • Guest
Question of the day #5
« Reply #11 on: December 01, 2004, 01:00:16 PM »
OK I found it but to not spoil all the fun I'll just drop a hint.  Has to do with a triangle.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Question of the day #5
« Reply #12 on: December 01, 2004, 01:05:09 PM »
Quote from: CarlB
OK I found it but to not spoil all the fun I'll just drop a hint.  Has to do with a triangle.

I was going to say dinner bell, but thought better of it. :D
TheSwamp.org  (serving the CAD community since 2003)

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Question of the day #5
« Reply #13 on: December 01, 2004, 01:07:53 PM »
Quote from: whdjr
Sounds great Se7en.

So whose got the encryption tool?  I know I had mine around here somewhere....?

We can make our own.  (I cant do it now cause all my stuff i at home. But i can see how far i can get.) But im sure some ones got some code that can be modified real quick.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

dubb

  • Swamp Rat
  • Posts: 1105
Question of the day #5
« Reply #14 on: December 01, 2004, 02:38:52 PM »
A WILD GUESS......pythagorean theorem? in code?