This is assignment congkak(mancala) game.Hope someone can fix and improve this code.
#include<iostream>
using namespace std;
bool checkWinningCondition(int board[], int SIZE)
{
int sum = 0;
for (int i = 0; i < SIZE; i++)
{
if (i == 9 || i == 19)
continue;
sum = sum + board[i];
}
return sum;
}
void display(int board[], int SIZE)
{
for (int i = 19; i >= 10; i--)
{
cout << board[i] << "\t";
}
cout << endl;
cout << "\t";
for (int i = 0; i < 10; i++)
{
cout << board[i] << "\t";
}
cout << endl;
}
void main()
{
int board[20];
for (int i = 0; i < 20; i++)
{
board[i] = 7;
}
board[9] = 0;
board[19] = 0;
display(board, 20);
int player = 1;
Line 5: This is a bool function. Line 14: You're trying to return sum. sum is going to be converted to a bool. Probably not what you want.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.