Best attack order for groups of numbers trying to destroy each other, given a victory chance for number to number attack.

skybuck2000 at skybuck2000 at
Sat Dec 17 17:39:08 EST 2016

Unless you are capable of expressing problems in numerical terms you'll have very hard luck having it computed by a computer ! ;)

I did find some interesting docs about "decision trees".

Exhaustive search
Branch and Bound
Hill Climbing
Random/Best Effort Solutions

and so forth.

A computer programmer should be able to handle abstract descriptions as well like I gave in my initial posting.

What kind of "dressing" you want to give it is up to you, the dressing won't solve it though ! :)

Meanwhile I have also consider some kind of lookup table... or an intermediate table like you described...

Not yet sure if that will be of any help... (I am in doubt about the dynamic nature of the battles... perhaps an intermediate table would be wrong... or maybe it might be right, dynamic deaths vs staying alive inside intermediate table and such).

I also tried the static approach by multiplieing chances instead of subtracting the chances like damage done.

I also experimented with "Pascal/Delphi sets" in combination with arrays... this produced a very easy/simple permutation algorithm which consisted out of multiple for loops, which is kinda the obvious way of easily creating permutations... but it was still kinda interesting.

There is a problem with such loops though, also like the one you mention "for each" and "for in" and such... "under water" the compiler will loop the entire range of the type, and will use compare statements to see if it should enter the inner loop. So there is hidden overhead associated with it.

Thus such "generating" of permutations on the fly might have a hidden overhead cost associated with it, even if this was not the case, such for loop constructs will definetly have overheads in certain situations and this can quickly get out of hand and could even consume more processing time then the entire program.

I did also briefly considered this permutation loop, though it would require a lot of programming, 8x4=24 for loops, plus possible an additional attack loop.

You do have a little point that without a clear story it might be hard to understand the exact problem. I may consider describing the problem one more time, but it might still be with number or blue berries ! LOL :)

More information about the Python-list mailing list