Hello.
I am trying to evaluate which of 4 variables have the lowest number. I have 4 variables, each of which represent the number of dead persons from a team. So for example:
Team A: 2 Dead
Team B: 3 Dead
Team C: 5 Dead
Team D: 9 Dead
These numbers can vary and I would like to be able to determine which team (variable) has the most amount of living persons. I can do that with the following code below. However, it is possible for 2+ teams to be tied with the least amount of living persons. For example:
Team A: 2 Dead
Team B: 2 Dead
Team C : 5 Dead
Team D: 9 Dead
What if 2, 3 or all 4 teams are tied with the lowest dead? I know one way to approach it. Check the values of each of the 4 variables and determine the lowest number. Then check each variable that matches that number and enable a respective switch.
So with the above example, it would identify 2 as the lowest number and turn on switches for Teams A and B. I'm not sure how to do that though. I googled that the javascript may be like:
Array.min = function( array ){
return Math.min.apply( Math, array );
};
But I'm not certain how to adjust that appropriately for MV's variables. Can anyone help me or show me a simpler solution?
I am trying to evaluate which of 4 variables have the lowest number. I have 4 variables, each of which represent the number of dead persons from a team. So for example:
Team A: 2 Dead
Team B: 3 Dead
Team C: 5 Dead
Team D: 9 Dead
These numbers can vary and I would like to be able to determine which team (variable) has the most amount of living persons. I can do that with the following code below. However, it is possible for 2+ teams to be tied with the least amount of living persons. For example:
Team A: 2 Dead
Team B: 2 Dead
Team C : 5 Dead
Team D: 9 Dead
What if 2, 3 or all 4 teams are tied with the lowest dead? I know one way to approach it. Check the values of each of the 4 variables and determine the lowest number. Then check each variable that matches that number and enable a respective switch.
So with the above example, it would identify 2 as the lowest number and turn on switches for Teams A and B. I'm not sure how to do that though. I googled that the javascript may be like:
Array.min = function( array ){
return Math.min.apply( Math, array );
};
Code:
var minimum = Array.min(array);
But I'm not certain how to adjust that appropriately for MV's variables. Can anyone help me or show me a simpler solution?
Code:
◆If:Total Dead (Now) = 0
◆Control Variables:#0395 Team Most = 0
◆Jump to Label:EXIT
◆
:End
◆If:Team A Dead Count < Team B Dead Count
◆If:Team A Dead Count < Team C Dead Count
◆If:Team A Dead Count < Team D Dead Count
◆Control Variables:#0395 Team Most = 1
◆
:End
◆
:End
◆
:End
◆If:Team B Dead Count < Team A Dead Count
◆If:Team B Dead Count < Team C Dead Count
◆If:Team B Dead Count < Team D Dead Count
◆Control Variables:#0395 Team Most = 2
◆
:End
◆
:End
◆
:End
◆If:Team C Dead Count < Team A Dead Count
◆If:Team C Dead Count < Team B Dead Count
◆If:Team C Dead Count < Team D Dead Count
◆Control Variables:#0395 Team Most = 3
◆
:End
◆
:End
◆
:End
◆If:Team D Dead Count < Team A Dead Count
◆If:Team D Dead Count < Team B Dead Count
◆If:Team D Dead Count < Team C Dead Count
◆Control Variables:#0395 Team Most = 4
◆
:End
◆
:End
◆
:End
◆Label:EXIT