:: warning (NULL, Warring raquo ;, tr ( Ви не можете видалити цю палубу! ));
}
} (player [i + 1] [j] == size)
{((player [i] [j - 1] == size) || (player [i] [j + 1] == size))
{= 1; :: warning (NULL, Warring raquo ;, tr ( Ви не можете видалити цю палубу! ));
}
} (player [i] [j - 1] == size)
{(player [i] [j + 1] == size)
{= 1; :: warning (NULL, Warring raquo ;, tr ( Ви не можете видалити цю палубу! ));
}
} (f!=1)
{[i] [j]=- 1; .addRect (jShip * sizeDeck, iShip * sizeDeck, sizeDeck, sizeDeck, QPen (Qt :: black), QBrush (Qt :: transparent)) ; (player [i - 1] [j] == size) .addLine (jShip * sizeDeck, iShip * sizeDeck, (jShip * sizeDeck + sizeDeck), iShip * sizeDeck, QPen (Qt :: red)); if (player [i + 1] [j] == size) .addLine (jShip * sizeDeck, (iShip * sizeDeck + sizeDeck), (jShip * sizeDeck + sizeDeck), (iShip * sizeDeck + sizeDeck), QPen (Qt :: red) ); if (player [i] [j - 1] == size) .addLine (jShip * sizeDeck, iShip * sizeDeck, jShip * sizeDeck, (iShip * sizeDeck + sizeDeck), QPen (Qt :: red)); if (player [i] [j + 1] == size) .addLine ((jShip * sizeDeck + sizeDeck), iShip * sizeDeck, (jShip * sizeDeck + sizeDeck), (iShip * sizeDeck + sizeDeck), QPen (Qt :: red));
-; (flag == 0) t=0;
}
}
}
PlayerField :: four ()
{= 4;
}
PlayerField :: three ()
{= 3;
}
PlayerField :: two ()
{= 2;
}
PlayerField :: one ()
{= 1;
}
PlayerField :: compFire ()
{i, j;
comp ();
(f!=1)
{
{();
} ((player [iShip - 1] [jShip - 1] == 2) || (player [iShip - 1] [jShip - 1] == 1)); (i=0 ; i lt; 4; i ++)
{[i] [0]=- 1; [i] [1]=- 1;
} ();
}
{(M [h] [0], M [h] [1]);
}
}
PlayerField :: checkAround (int x, int y)
{m, n, p, q; (x == 0) m=0; m=x - 1;
(y == 0) n=0; n=y - 1;
(x == 9) p=9; p=x + 1;
(y == 9) q=9; q=y + 1;
(player [m] [y] lt;=0)
{= x;=y + 1; (); (move!=1)
{= x + 1;=y + 1;
}
} if (player [x] [n] lt;=0)
{= x + 1;=y; (); (move!=1)
{= x + 1;=y + 1;
}
} if (player [x] [q] lt;=0)
{= x + 1;=y + 2; (); (move!=1)
{= x + 1;=y + 1;
}
} if (player [x + 1] [y] lt;=0)
{= x + 2;=y + 1; (); (move!=1)
{= x + 1;=y + 1;
}
}
{++; (M [h] [0], M [h] [1]);
}
}
:: ~ PlayerField ()
{
}
Файл putname.h
# ifndef PUTNAME_H
# define PUTNAME_H
# include lt; QtGui gt; PutName: public QDialog
{_ OBJECT: ();
~ PutName ();
* label; * edit; * button; * layout; playerName;
: PNSignal ();
slots: setName ();
: output ();
};
# endif//PUTNAME_H
Файл putname.cpp
# include putname.h
:: PutName ()
{= new QLabel ( Введіть ім'я гравця: );=new QLineEdit;=new QPushButton (tr ( OK ));=new QVBoxLayout; (); :: connect (button, SIGNAL (clicked ()), this, SLOT (setName ()));
}
PutName :: output ()
{ gt; addWidget (label); gt; addWidget (edit); gt; addWidget (button); (layout);
}
PutName :: setNam...