Superheroes V2

                Never    
C#
       
Global:
int S = 0;
int B = 0;
int F = 0;
int medallasS = 0;
int medallasB = 0;
int medallasF = 0;

btnSalvarCiudad_Click:
{
if(txtBox.text == "S")
{
 S = S + 10;
 txtBox.clear();
}
else if(txtBox.text == "B")
{
B = B + 10;
txtBox.clear();
}
else if(txtBox.text == "F")
{
F = F + 10;
txtBox.clear();
}
}

btnSalvarMundo.Click:
{
if(txtBox.text == "S")
{
S = S + 100;
txtBox.clear();
}
else if(txtBox.text == "B")
{
B = B + 100;
txtBox.clear();
}
else if(txtBox.text == "F")
{
F = F + 100;
txtBox.clear();
}
}

btnFinDeAño_Click:
{
if(S > B && S > F)
{
medallasS++; //cuando se pone doble mas significa que se suma 1
MessageBox.Show("Superman tuvo mas puntos que todos, por lo tanto gana una medalla");
}
else if(B > S && B > F)
{
medallasB++;
MessageBox.Show("Batman tuvo mas puntos que todos, por lo tanto gana una medalla")
}
else if(F > S && F > B)
{
medallasF++;
MessageBox.Show("Flash tuvo mas puntos que todos, por lo tanto gana una medalla")
}
else if(S == B && B == F)
{
medallasS++;
medallasB++;
medallasF++;
MessageBox.Show("Todos tuvieron los mismos puntos, todos reciben una medalla")
}
else if(S == B)
{
medallasS++;
medallasB++;
MessageBox.Show("Superman y batman obtuvieron los mismos puntos, ambos reciben una medalla")
}
else if(S == F)
{
medallasS++;
medallasF++;
MessageBox.Show("Superman y Flash obtuvieron los mismos puntos, ambos reciben una medalla")
}
else if(B == F)
{
medallasB++;
medallasF++;
MessageBox.Show("Flash y Batman obtuvieron los mismos puntos, ambos reciben una medalla")
}
S = 0;
B = 0;
F = 0;
}

btnHistorialMedallas_Click:
{
MessageBox.Show("Superman gano " + medallasS + " medallas");
MessageBox.Show("Batman gano " + medallasB + " medallas");
MessageBox.Show("Flash gano " + medallasF + " medallas");
}

Raw Text