Jan-18-2019, 08:21 PM
Code: yeah explaining is difficult (can paste the whole code but it's a mixed with specific programming coding which makes things more unclear while the case is easier)
Trying a different explaination approach:
pos1 pos2 pos3 can be
1. pos1, pos2, pos3
2. pos1, pos2
3. pos1, pos3
each possibility triggers another value in a customfunction (hence the b, c, d value)
BUT I want things nice and tidy.
so call them first place, second place, and third place if you like:
1. first, second, third
2. first, second
3. first, second
My quesiton is about 2. and 3.: how to ensure that a T/F decisions triggers the correct places?
Makes more sense?
I read my coding as follows:
"pos1 is already given, and is executed. if pos2 is True, assign it to position 2 and while I'm at it: if pos3 is true: assign that to the third place. IF pos2 isn't true, and pos3 is True, assign position 2 to pos3."
or perhaps even easier: 3 runners participate in a competition. they can end up 1, 2, 3. If 2 backs out: number 3 becomes second not 3th. How to achieve that?
I thought using a while function (I can get the amount of participants) BUT the customfunction triggers not only that but also another value (b, c, d) ...
Horrible at explaining stuff. Sorry.
Trying a different explaination approach:
pos1 pos2 pos3 can be
1. pos1, pos2, pos3
2. pos1, pos2
3. pos1, pos3
each possibility triggers another value in a customfunction (hence the b, c, d value)
BUT I want things nice and tidy.
so call them first place, second place, and third place if you like:
1. first, second, third
2. first, second
3. first, second
My quesiton is about 2. and 3.: how to ensure that a T/F decisions triggers the correct places?
Makes more sense?
I read my coding as follows:
"pos1 is already given, and is executed. if pos2 is True, assign it to position 2 and while I'm at it: if pos3 is true: assign that to the third place. IF pos2 isn't true, and pos3 is True, assign position 2 to pos3."
or perhaps even easier: 3 runners participate in a competition. they can end up 1, 2, 3. If 2 backs out: number 3 becomes second not 3th. How to achieve that?
I thought using a while function (I can get the amount of participants) BUT the customfunction triggers not only that but also another value (b, c, d) ...
Horrible at explaining stuff. Sorry.
triggers = [100,200,300] pos1 = True #never changes pos2 = True pos3 = True if pos1: customfunction(a, d, triggers[0]) if pos2: customfunction(a, b, triggers[1]) if pos3: customfunction(a, c,triggers[2]) elif pos3: customfunction(a, c, triggers[1])