changing values of int

If i have int x=8, is there a way to change the value of x only if it is in an if statement.
What? What do you mean? Can you give an example of what you'd like to happen?
nvm i figured that out. but now i need help turning my if statements into functions.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if (board[place - 1][move] == 'O' || board[place - 1][move] == 'X') {

			board[place - 2][move] = temp;

			move_counter = move_counter + 1;
			display_board(board);
			continue;
		}
		if (board[place][move] == 'O' || board[place][move] == 'X') {

			board[place - 1][move] = temp;
			move_counter = move_counter + 1;
			display_board(board);
			continue;


		}

		else {

			board[place][move] = temp;

			move_counter = move_counter + 1;
			display_board(board);
			continue;

		}
Topic archived. No new replies allowed.