Skip to content

Commit 6458139

Browse files
committed
fix: declare in the beginning
1 parent 840baee commit 6458139

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/play/tateti/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ unsigned char checkInputFormat(inputValuePlayer *datainput, char *_input) {
255255

256256
int playComputer(IPlayer *_AI, Board *_board, int opponentValue) {
257257
DataAI _AIdata;
258+
int drawThis, winThis;
258259

259260
if (getEmptySpaces(_board) > 6) {
260261
randomMovement(getArray2D(_board), getInternalForm(_AI));
@@ -264,8 +265,8 @@ int playComputer(IPlayer *_AI, Board *_board, int opponentValue) {
264265

265266
DataComputerConstructor(&_AIdata);
266267

267-
int winThis = getInternalForm(_AI) * getInternalForm(_AI);
268-
int drawThis = opponentValue * opponentValue;
268+
winThis = getInternalForm(_AI) * getInternalForm(_AI);
269+
drawThis = opponentValue * opponentValue;
269270

270271
checkRaws(getArray2D(_board), &_AIdata, winThis, drawThis);
271272
checkColumns(getArray2D(_board), &_AIdata, winThis, drawThis);

0 commit comments

Comments
 (0)