From 9fae0e4409ea9c95a641cb51f696187a4a9f70a2 Mon Sep 17 00:00:00 2001 From: Captain ALM Date: Fri, 26 Aug 2022 14:32:00 +0100 Subject: [PATCH] Tell the player if they guess lower or higher than the target. --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 9149cf8..4633ac8 100644 --- a/main.cpp +++ b/main.cpp @@ -16,7 +16,12 @@ int main() bool once {}; int num {clamp(rand)}, ent {}; do { - if (once) std::cout << "You Guessed Wrong!\n"; + if (once) { + if (ent > num) + std::cout << "You Guessed Too High!\n"; + else + std::cout << "You Guessed Too Low!\n"; + } ent = promptfi("Enter your guess:"); once = true; }