Flussdiagramm
Ohne Titel
Inhalt des Flussdiagramms
Inicio
public int Jugadores = 2;
public int turnos = 0;
public int s1 = 0;
public int s2 = 0;
public int sd = 0;
Jugadores = 2;
turnos = 0;
A01.Text = A00.Text = A02.Text = A10.Text = A11.Text = A20.Text = A20.Text = A21.Text = A22.Text = "";
label1.Text = "X: " + s1;
label2.Text = "O: " + s2;
label3.Text = "Draws: " + sd;
bool CheckWinner()
{
if ((A01.Text == A00.Text)&& (A00.Text == A02.Text) && A01.Text !="")
return true;
else if ((A10.Text == A11.Text) && (A11.Text == A12.Text) && A10.Text != "")
return true;
else if ((A20.Text== A21.Text)&& (A21.Text== A22.Text)&& A20.Text!="")
return true;
if ((A01.Text == A10.Text) && (A10.Text == A20.Text) && A01.Text != "")
return true;
else if ((A00.Text == A11.Text) && (A11.Text == A21.Text) && A00.Text != "")
return true;
else if ((A02.Text==A12.Text)&&(A12.Text==A22.Text)&&A02.Text!="")
return true;
if ((A01.Text == A11.Text) && (A11.Text == A22.Text) && A01.Text != "")
return true;
else if ((A02.Text == A11.Text) && (A11.Text == A20.Text) && A02.Text != "")
return true;
else
return false;
{
private void buttonClick(object sender, EventArgs e)
{
Button button = (Button)sender;
if (button.Text == "")
{
}
if (Jugadores % 2 == 0)
{
button.Text = "x";
Jugadores++;
turnos++;
}
else
{
button.Text = "0";
Jugadores++;
turnos++;
}
if (CheckDraw() == true)
{
MessageBox.Show("Tie Game!");
sd++;
NewGame();
}
if (CheckWinner() == true)
{
if (button.Text == "X")
{
MessageBox.Show("X Won!");
s1++;
NewGame();
}
else
{
MessageBox.Show("0 Won!");
s2++;
NewGame();
}
Informationen
- Beschreibung
- Flussdiagramm am Ohne Titel, erstellt von Paola Ponce am 07/10/2019.
- Erstellt von
- Paola Ponce
- Aufrufe
- 0
- Bewertung