2 arrays are created:
- Array of Card objects - tables with numbers.
- The main numbers of this array, in this case the power of two.
4 values must be created. With objects it works, but not with numbers.
Code:
int* AllNumList; int Cmin=0, Cmax=0; void Game() { bool end = 0; int numOfIterations = 0; int maxNum = 1; while (maxNum <= Cmax) { numOfIterations++; maxNum = pow(2, numOfIterations); } numOfIterations--; maxNum = pow(2, numOfIterations); Card* card = new Card [numOfIterations +1]; AllNumList = new int [numOfIterations+1]; for (int i = 0; i <= numOfIterations;i++) { AllNumList[i] = pow(2, i); card[i].AddGenNumber(pow(2, i)); } } First loop iteration:
Last iteration:


AddGenNumbererror inAddGenNumber... you do not give its text. - Harry