Hi:
What about the restrictions over a,b and the increment?
in some situations the final condition will never be acomplished (example:
a:=5;b:=100;inc:=10), in other cases you will end up with the average(a,b)
:(a+b)/2.
If you use a while (/= a b) loop, will never stop in a lot of initial
conditions.
If you use a while (a < b) the loop will end, but never with a=b.
The result of the loop will be (ever) a:=a+n*inc ; b:=b-n*inc, so if the
equation (in n integer) : a+n*inc=b-n*inc can be solved you have good
initial conditions and the result will be the average(a,b), otherways they
are ill conditioned over the final restriction a=b.
So the question is: what are you trying to find out?
Gaston
"pipouchette" wrote in message news:6300108@discussion.autodesk.com...
> hi, i'm trying to make a repetitive proccess that makes something like
> this:
> (while (/= a b)
> (do (setq a (+ a 10) b (- b 10))
>
> and so on until (= a b)
>
> and my initial code is the following:
>
> (defun pipu ()
> (setq a 0)
> (setq b 100)
> (if (= a b)
> (progn
> (princ "\nA = B "))
> (setq a (+ a 10) b (- b 10))))
>
>
>
> thanks to everyone that could help me
>
> Edited by: pipouchette on Dec 6, 2009 1:22 PM