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 << " "; cout << " ";
for(int col = 0; col < M; col++) for(int col = 0; col < M; col++)
cout << col; cout << col;
cout << std::endl; cout << '\n';
for(int i = 0; i < N; i++) { for(int i = 0; i < N; i++) {
cout << i; cout << i;
for(auto col : possible[i]) for(auto col : possible[i])
cout << col; cout << col;
cout << std::endl;; cout << '\n';
} }
cout << std::endl; cout << '\n';
} }
// Learning functions // Learning functions

View file

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