std::endl into \n

This commit is contained in:
Matúš Púll 2024-12-04 12:46:56 +01:00
parent 137c23cda7
commit 59f246f918
2 changed files with 11 additions and 11 deletions

View file

@ -63,14 +63,14 @@ void Game::print() {
cout << " ";
for(int col = 0; col < M; col++)
cout << col;
cout << std::endl;
cout << '\n';
for(int i = 0; i < N; i++) {
cout << i;
for(auto col : possible[i])
cout << col;
cout << std::endl;;
cout << '\n';
}
cout << std::endl;
cout << '\n';
}
// Learning functions

View file

@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
if(gen == RANDOM)
sequence = generate(N, M);
else if(gen == HUMAN) {
cout << "Enter " << N << " space-separated numbers from 0 to " << M-1 << std::endl;
cout << "Enter " << N << " space-separated numbers from 0 to " << M-1 << '\n';
for(int n = 0; n < N; n++)
cin >> sequence[n];
}
@ -43,10 +43,10 @@ int main(int argc, char* argv[]) {
// Human info
if(human_player) {
cout << std::endl;
cout << "Guesses are " << N << " space-separated numbers from 0 to " << M-1 << std::endl
<< "Responses are in format [correct out of place] / [correct in place]" << std::endl;
cout << std::endl;
cout << '\n';
cout << "Guesses are " << N << " space-separated numbers from 0 to " << M-1 << '\n'
<< "Responses are in format [correct out of place] / [correct in place]" << '\n';
cout << '\n';
}
// Init solver
@ -88,17 +88,17 @@ int main(int argc, char* argv[]) {
}
// Terminal clearing
cout << std::endl;
cout << '\n';
// Print game history
if(human_player)
cout << "History\n";
for(auto guess : history)
cout << format_guess_history(sequence, guess) << std::endl;
cout << format_guess_history(sequence, guess) << '\n';
// Loss
if(history.back() != sequence) {
cout << format_lost_sequence(sequence) << std::endl;
cout << format_lost_sequence(sequence) << '\n';
return 1;
}