orm :: DannieToChar (int Type, int MyCurOch, int MyWholeOch, ​​
int ZnachKub1, int XKub1, int YKub1,
int ZnachKub2, int XKub2, int YKub2,
int ZnachKub3, int XKub3, int YKub3,
int ZnachKub4, int XKub4, int YKub4
)
{
AnsiString
IntToStr (ZnachKub1) + ";" + IntToStr (XKub1) + ";" + IntToStr (YKub1) + ";" +
IntToStr (ZnachKub2) + ";" + IntToStr (XKub2) + ";" + IntToStr (YKub2) + ";" +
IntToStr (ZnachKub3) + ";" + IntToStr (XKub3) + ";" + IntToStr (YKub3) + ";" +
IntToStr (ZnachKub4) + ";" + IntToStr (XKub4) + ";" + IntToStr (YKub4) + ";";
return strTmp.c_str ();
}
// --------------------------------------------- ------------------------------
int * __ fastcall TMainForm :: CharToMas (char * charPriem)
{
AnsiString strPriem = charPriem;
MasPriem = new int [15];
int y = 0;
int PrevDelim = 0;
int CurDelim;
for (int i = 1; i <= strPriem.Length (); i + +)
{
if (IsDelimiter (";", strPriem, i))
{
MasPriem [y + +] = StrToInt (MidStr (strPriem, PrevDelim +1, i-PrevDelim-1));
PrevDelim = i;
}
}
return MasPriem;
}
// Кинути -------------------------------------------- -------------------------------
void __ fastcall TMainForm :: btBrosit2Click (TObject * Sender)
{
Graphics :: TBitmap * Bitmap1 = new Graphics :: TBitmap ();
char strSend [70];
AnsiString strCat;
if (IsServer)
{
NomHoda + +;
strCat = "";
}
else
{
strCat = "_2";
}
if (KolKub == 1)
{
int ZnachKub, XKub, YKub;
randomize ();
ZnachKub = random (6) +1;
XKub = random (126) +14;
YKub = random (126) +14;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub) + strCat);
Kubiki1 [0] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [0] -> Left = XKub;
Kubiki1 [0] -> Top = YKub;
Kubiki1 [0] -> Visible = true;
MyCurOch = ZnachKub;
MyWholeOch = MyWholeOch + MyCurOch;
strcpy (strSend, DannieToChar (1, MyCurOch, MyWholeOch, ​​ZnachKub, XKub, YKub));
}
else if (KolKub == 2)
{
int ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2;
randomize ();
ZnachKub1 = random (6) +1;
XKub1 = random (126) +14;
YKub1 = random (52) +14;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub1) + strCat);
Kubiki1 [0] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [0] -> Left = XKub1;
Kubiki1 [0] -> Top = YKub1;
Kubiki1 [0] -> Visible = true;
ZnachKub2 = random (6) +1;
XKub2 = random (126) +14;
YKub2 = random (52) +88;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub2) + strCat);
Kubiki1 [1] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [1] -> Left = XKub2;
Kubiki1 [1] -> Top = YKub2;
Kubiki1 [1] -> Visible = true;
MyCurOch = ZnachKub1 + ZnachKub2;
MyWholeOch = MyWholeOch + MyCurOch;
strcpy (strSend, DannieToChar (1, MyCurOch, MyWholeOch, ​​ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2));
}
else if (KolKub == 3)
{
int ZnachKub1, XKub1, YKub1, ZnachKub2, XKub2, YKub2, ZnachKub3, XKub3, YKub3;
randomize ();
ZnachKub1 = random (6) +1;
XKub1 = random (126) +14;
YKub1 = random (27) +14;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub1) + strCat);
Kubiki1 [0] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [0] -> Left = XKub1;
Kubiki1 [0] -> Top = YKub1;
Kubiki1 [0] -> Visible = true;
ZnachKub2 = random (6) +1;
XKub2 = random (126) +14;
YKub2 = random (27) +63;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub2) + strCat);
Kubiki1 [1] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [1] -> Left = XKub2;
Kubiki1 [1] -> Top = YKub2;
Kubiki1 [1] -> Visible = true;
ZnachKub3 = random (6) +1;
XKub3 = random (126) +14;
YKub3 = random (28) +112;
Bitmap1-> LoadFromResourceName ((unsigned int) HInstance, "KUB" + IntToStr (ZnachKub3) + strCat);
Kubiki1 [2] -> Picture-> Bitmap = Bitmap1;
Kubiki1 [2] -> Left = XKub3;
Kubiki1 [2] -> Top = YKub3;
Kubiki1 [2] -> Visible = true;
...