fix: bucles cap a ranges algorithms (38 troballes)

This commit is contained in:
2026-05-14 21:36:21 +02:00
parent 0aa9f8fe0a
commit b4d3776239
14 changed files with 110 additions and 169 deletions

View File

@@ -38,9 +38,9 @@ GameOver::GameOver()
// Inicializa el vector de colores (de brillante a oscuro para fade)
const std::vector<std::string> COLORS = {"white", "yellow", "cyan", "green", "magenta", "red", "blue", "black"};
for (const auto& color : COLORS) {
colors_.push_back(stringToColor(color));
}
colors_.reserve(COLORS.size());
std::ranges::transform(COLORS, std::back_inserter(colors_),
[](const auto& color) { return stringToColor(color); });
color_ = colors_.back(); // Empieza en black
}