I having trouble trying to set up a list, input would help...
this is a crude beginning but I'm getting stumped with an important main part...that is, I want to make a calculation, store it to a variable, increment the variable, then store info to that one and so on...
(defun allnecks (/ A nxt_brch)
;; force an answer
(initget 1)
;; get the size of the main duct, set to "main"
(setq main (getreal "\nEnter duct size of main:")
;; set up loop
loop t
;; setup to start variable first is "branch A"
nxt_brch (chr 65)
)
;; start loop
(while loop
;; get width of branch
(setq wid (getreal "\nEnter target branch Width:")
;; get depth of branch
dep (getreal "\nEnter target branch Depth:")
)
;; mutliply width x depth and save to variable A and put into a list
(setq branch (* wid dep)) ;<====not finished
;; if null response to width or depth, exit loop
(if (null (or wid dep))
(setq loop nil)
)
;; increment variable and repeat
(setq new_brch (1+ (ascii nxt_brch)))
)
;; get sum of all variables in the list set to variable "total"
;; then divide each variable in the list by "total", and multiply by "main"
;; got to text screen and print out out all branches
)