Variable Array / Better way?

hey,

i have the 10 stages of a game, based out with a generator to get me (in essence)

int puzzle1[10] = {3, 5, 3, 5, 3, 5, 3, 5, 3, 5};

now, when the game is completed the difficulty increases for the next game, and what i want is the length of the array to increase (say to 11)

now i can set a const int, but then i cant change the const int, and i believe that i can delete the array and set a new sized array, but as the size of the array is controlled by a variable, it doesnt seem to click.

puzzle generator below.

void randomPuzzleGenerator () {
  randNumber = random(6); // generate number between 1 and 6 inclusive
  for (int i = 0; i < puzzleSteps; i++) {
    puzzle1[i] = randNumber;  // push a number into the puzzle string
    randNumberOld = randNumber; // save the number
    randNumber = random(6); // generate a new number
    while (randNumber == randNumberOld) randNumber = random(6); // if its the same number, get a new number
    while (randNumberOld == 2 && randNumber == 5) randNumber = random(6); // 2 & 5 // if an opposite number is generated, get a new number
    while (randNumberOld == 5 && randNumber == 2) randNumber = random(6); // 5 & 2
    while (randNumberOld == 1 && randNumber == 4) randNumber = random(6); // 1 & 4
    while (randNumberOld == 4 && randNumber == 1) randNumber = random(6); // 4 & 1
    while (randNumberOld == 0 && randNumber == 3) randNumber = random(6); // 0 & 3
    while (randNumberOld == 3 && randNumber == 0) randNumber = random(6); // 3 & 0
    //        Serial.print(sides[puzzle1[i]]); Serial.print(" ");
    Serial.print(puzzle1[i]); Serial.print(" ");
  }
  Serial.println();
}

Define the array in the size that corresponds to you maximum difficulty and use only the first part of it for the easy steps.

Whandall:
Define the array in the size that corresponds to you maximum difficulty and use only the first part of it for the easy steps.

boom! legendarily simple logic that ive been overthinking!

in essence i can make an array that is 200 steps long... an impossible limit!

thanks!

in essence i can make an array that is 200 steps long... an impossible limit!

Please use bytes instead of ints to save memory if the numbers will never be greater than 255.