{->Socket->Connections[0]->SendText("O");("Ви виграли");
}
}
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------__fastcall TForm1::FormCreate(TObject *Sender)
{->Active=true;
}
//---------------------------------------------------------------------------__fastcall TForm1::ServerSocket1ClientConnect(TObject *Sender,*Socket)
{->SimpleText="Connect";
}
//---------------------------------------------------------------------------__fastcall TForm1::ServerSocket1ClientDisconnect(TObject *Sender,*Socket)
{->SimpleText="Disconnect";
}
//---------------------------------------------------------------------------__fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,*Socket)
{a;="";=Socket->ReceiveText();(a=="X")
{("Виграли хрестики");
}
{(a=="b2")
{->Caption="X";->Enabled=false;
}
{(a=="b3")
{->Caption="X";->Enabled=false;
}
{(a=="b4")
{->Caption="X";->Enabled=false;
}
{(a=="b5")
{->Caption="X";->Enabled=false;
}
{(a=="b6")
{->Caption="X";->Enabled=false;
}
{(a=="b7")
{->Caption="X";->Enabled=false;
}
{(a=="b8")
}
{(a=="b9")
{->Caption="X";->Enabled=false;
}
{(a=="b10")
{->Caption="X";->Enabled=false;
}
{->Lines->Insert(0,"Суперник:"+a);
}
} } } } } } } } }
}
//---------------------------------------------------------------------------__fastcall TForm1::Button2Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b2");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button3Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b3");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button4Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b4");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button5Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b5");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button6Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b6");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button7Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b7");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button8Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b8");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button9Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b9");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Button10Click(TObject *Sender)
{->Socket->Connections[0]->SendText("b10");->Caption="O";->Enabled=false;();
}
//---------------------------------------------------------------------------__fastcall TForm1::Edit2KeyDown(TObject *Sender, WORD &Key,Shift)
{(Key==13)
{->Lines->Insert(0,"Ви:"+Edit2->Text);->Socket->Connections[0]->SendText(Edit2->Text);->Text="";
}
}
//---------------------------------------------------------------------------