Having duplicate enumerator values
- by whirlwin
I'm creating a Tetris clone in C++, and I have an enum GameProperty, which is specified as follows:
enum GameProperty {
NUM_OF_TETROMINOES = 7,
NUM_OF_TILES = 4,
TETROMINO_ROTATIONS = 4
};
In my case, I only use these values when looping through a tetromino's tiles, e.g:
for (int i = 0; i < TETROMINO_TILES; i++) { }
Is it under any circumstance considered bad practice to have multiple enumerators with the same value?