Hello, hoping someone can put in their two cents on how to compact IF statements and variable assignments.
In the below partial code snippet, I set up 100 variables for optimization. Then, depending on the optimization, I want to set the "final" variable to the optimized variable. But this entails me manually writing out 100 IF statements. Is there some function or coding strategy that can be used to compact all of the below?
A = Optimize("A", 0, 0, 100, 1);
Tier0 = Rank < 0;
Tier1 = Rank >=0 AND Rank < 60;
Tier2 = Rank >=30 AND Rank < 60;
Tier3 = Rank >=60 AND Rank < 90;
Tier4 = Rank >=90 AND Rank < 120;
.
. ETC.
.
Tier100 = Rank... ETC.
if(A == 0) Tier = Tier0;
if(A == 1) Tier = Tier1;
if(A == 2) Tier = Tier2;
if(A == 3) Tier = Tier3;
if(A == 4) T ier = Tier4;
.
. ETC.
.
if(A ==100) Tier = Tier100;
Buy = Tier;