From 59f246f918bc851fd5e62b3685f5c10e001c79d1 Mon Sep 17 00:00:00 2001 From: Matuush Date: Wed, 4 Dec 2024 12:46:56 +0100 Subject: [PATCH] std::endl into \n --- game.cpp | 6 +++--- main.cpp | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/game.cpp b/game.cpp index d588563..964f74f 100644 --- a/game.cpp +++ b/game.cpp @@ -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 diff --git a/main.cpp b/main.cpp index 6f4e09c..23224f7 100644 --- a/main.cpp +++ b/main.cpp @@ -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; }