|
|
@ -51,9 +51,12 @@ vector<Stack> Day05::parseStacks(){ |
|
|
|
for (int i = 0; i < stackCount; i++){ |
|
|
|
for (int i = 0; i < stackCount; i++){ |
|
|
|
parsed.emplace_back(); |
|
|
|
parsed.emplace_back(); |
|
|
|
int index = 1 + 4 * i; |
|
|
|
int index = 1 + 4 * i; |
|
|
|
|
|
|
|
|
|
|
|
for (size_t line = endIndex - 2; input[line].size() > index && input[line][index] != ' '; line--){ |
|
|
|
for (size_t line = endIndex - 2; input[line].size() > index && input[line][index] != ' '; line--){ |
|
|
|
Crate crate = input[line][index]; |
|
|
|
Crate crate = input[line][index]; |
|
|
|
parsed[i].push_back(crate); |
|
|
|
parsed[i].push_back(crate); |
|
|
|
|
|
|
|
if (line == 0) |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|