Code: Select all
if stat1_points and stat2_points > stat3_points and stat4_points...:
jump label discussstat1and2
if stat1_points and stat3_points > stat2_points and stat4_points...:
jump label discussstat1and3
...
Code: Select all
if stat1_points and stat2_points > stat3_points and stat4_points...:
jump label discussstat1and2
if stat1_points and stat3_points > stat2_points and stat4_points...:
jump label discussstat1and3
...
Code: Select all
$ stat_list = [stat1_points, stat2_points, stat3_points, ...]
jump expression ("disscussstat" + "and".join([str(y+1) for (x,y) in sorted(zip([-x for x in stat_list], range(10)))[:2]]))
Code: Select all
$ stat_list = [stat1_points, stat2_points, stat3_points, ...]
jump expression ("disscussstat" + "and".join([str(y+1) for (x,y) in sorted(zip([-x for x in stat_list], range(10)))[:2]]))
Code: Select all
$ stat_list = [stat1_points, stat2_points, stat3_points, ...]
jump expression ("disscussstat" + "and".join([str(y+1) for (x,y) in sorted(zip([-x for x in stat_list], range(10)))[:2]]))
Code: Select all
$ (max_points, max_index) = max(zip(stat_list, range(10)))
if max_points < 10:
jump failed
jump expression ("discussionstat" + max_index)
Thank you so much! I definitely understand more this time around! I don't really care if the stats are tied; does the tie just go in order of the first label?apricotorange wrote:Do you care what the behavior is if multiple stats are tied?
A bit more readable this time:
Code: Select all
$ (max_points, max_index) = max(zip(stat_list, range(10))) if max_points < 10: jump failed jump expression ("discussionstat" + max_index)
HeavenlyJoker wrote:Thank you so much! I definitely understand more this time around! I don't really care if the stats are tied; does the tie just go in order of the first label?apricotorange wrote:Do you care what the behavior is if multiple stats are tied?
A bit more readable this time:
Code: Select all
$ (max_points, max_index) = max(zip(stat_list, range(10))) if max_points < 10: jump failed jump expression ("discussionstat" + max_index)
I do seem to get an error though, and I'm not sure how to fix it; it says "TypeError: cannot concatenate 'str' and 'int' objects". Any thoughts? :3
Code: Select all
jump expression ("discussionstat" + str(max_index))
Now it's showing "ScriptError: could not find label 'discissionstat0'.xela wrote:
Try the same code but:Code: Select all
jump expression ("discussionstat" + str(max_index))
?HeavenlyJoker wrote:Now it's showing "ScriptError: could not find label 'discissionstat0'.xela wrote:
Try the same code but:Code: Select all
jump expression ("discussionstat" + str(max_index))
Code: Select all
$ (max_points, max_index) = max(zip(stat_list, range(1, 11)))
if max_points < 10:
jump failed
jump expression ("discussionstat" + str(max_index))
Code: Select all
$ (max_points, max_index) = max(zip(stat_list, range(10)))
if max_points < 10:
jump failed
jump expression ("discussionstat" + str(max_index+1))
Users browsing this forum: No registered users