Wouldn't this be a perfect example of when NOT to use a rulebased system?  Meaning, that this is nothing more than a mathematical calculation, get a user input, calculate and answer, display the output.  Static.  No "real" intelligence?  It "can" be done this way but "should" it be done this way?  Methinks not.

SDG
jco

[EMAIL PROTECTED] wrote:
I think [EMAIL PROTECTED] wrote:
  

  
NORMAL WEIGHT = HEIGHT - 100 - (HEIGHT - 100) /a
    
...

  
(deffunction pottons-formula
(?height ?a)
(-(- ?height 100)(/ ?a(- ?height 100))))
    

  
...but the result is incorrect (program returns: 59.666..., and should
return: 72.0).
I don't get where is my mistake (in formula??)?
    


You've got the arguments to "/" in reverse order; they should appear
in the same order they appear in the original infix _expression_. Also,
although your use of two "-" operators isn't incorrect, you can
combine the expressions into one for a more natural effect, like

(deffunction pottons-formula (?height ?a)
  (- ?height 100 (/ (- ?height 100) ?a)))

  
And how to take inputs (using <read> command) from user (?YOUR-WEIGHT
?YOUR-HEIGHT
?ARE YOU WOMEN OR MEN)?
    


(printout t "Your height? ")
(bind ?height (read))



---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED].
--------------------------------------------------------------------

  

Reply via email to