I am having trouble figuring out an efficient way to perform the checks for how a winner is determined in a 3D tic tac toe program (that is 3x3x3). Winners can be three spaces in any vertical, horizontal, or diagonal, including those between the 3 "boards." There are over 50 winning possibilities, but I'm not sure exactly how many there are. The grid is represented by the 3D array char grid[3][3][3]. My intention is to check every possible winning combination by adding up the ASCII values held by each position (which will either be a ' ', 'X', or 'O', with respective ASCII values of 32, 88, and 79) and dividing it by 3. That value will be assigned to a variable int sum. Then I will have an if statement after each check as follows:

```
if(sum==88 || sum==79)
{
return sum;
}
```

By returning sum, it will tell me whether X or O won, based on if 88 or 79 was returned.

Can anyone help?