Implement Getting Code from Console

This commit is contained in:
Matti 2024-11-13 21:23:01 +01:00
parent 90b0e5bd19
commit 1d32b4798d

View File

@ -41,14 +41,20 @@ std::vector<std::string> generateSecretCode(int digits, int optionsPerDigit) {
} }
std::vector<std::string> getCodeGuessFromConsole() { std::vector<std::string> getCodeGuessFromConsole() {
std::cout << "Have a Guess! :" << std::endl; std::cout << "Have a Guess!" << std::endl;
std::string input;
std::cin >> input;
std::vector<std::string> guess; std::vector<std::string> guess;
split(input, ' ', guess); // TODO Make limit dynamic
for (int i = 1; i < 5; ++i) {
std::cout << "Enter Digit " << i << " : " << std::endl;
std::string input;
std::cin >> input;
guess.push_back(input);
}
std::cout << "You entered: " << std::endl;
printAllStringsInVector(guess);
return guess; return guess;
} }
@ -68,7 +74,4 @@ void Aufg5Main() {
std::vector<std::string> guess = getCodeGuessFromConsole(); std::vector<std::string> guess = getCodeGuessFromConsole();
printAllStringsInVector(guess);
} }