Implement Getting Code from Console
This commit is contained in:
parent
90b0e5bd19
commit
1d32b4798d
@ -41,14 +41,20 @@ std::vector<std::string> generateSecretCode(int digits, int optionsPerDigit) {
|
||||
}
|
||||
|
||||
std::vector<std::string> getCodeGuessFromConsole() {
|
||||
std::cout << "Have a Guess! :" << std::endl;
|
||||
|
||||
std::string input;
|
||||
std::cin >> input;
|
||||
std::cout << "Have a Guess!" << std::endl;
|
||||
|
||||
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;
|
||||
}
|
||||
@ -68,7 +74,4 @@ void Aufg5Main() {
|
||||
|
||||
std::vector<std::string> guess = getCodeGuessFromConsole();
|
||||
|
||||
printAllStringsInVector(guess);
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user