I have this function:
Code: Select all
Function CHEAPTE(glory,te,palace,tech,libs,discte,discpalace,disctech)
CHEAPTE = -1
DO
CHEAPTE = CHEAPTE+1
LOOP WHILE CPPTE(glory,te+CHEAPTE,palace,tech,1,discte) < CPPPALACE(glory,te+CHEAPTE,palace,tech,1,discpalace)
End Function
It turns out to be an infinite loop. I have used the CPPTE and CPPPALACE and a manual incrementer to simulate the CHEAPTE and I know that the 2 functions will evetually return values that will stop the loop - meaning the loop as I envision it. I can only imagine that the code is malformed in some way (te+CHEAPTE?). I have tried using a temp value and incrementing the temp rather than using te+CHEAPTE with no effect. If the starting values are such that CPPTE is already greater than CPPPALACE, the loop never executes and I get a value of 0 returned as expected. I've tried using WHILE WEND also, with no luck.
Yes, this is game related. Yes, I have successfully been creating functions and loops previously.