From 55d6f3416fcd7ac52215b0286204b8aa7eb7870e Mon Sep 17 00:00:00 2001 From: Ryan Fong Date: Mon, 21 Feb 2022 11:20:29 -0800 Subject: [PATCH] Resolves ChicoState/Wordler#2, Resolves ChicoState/Wordler#1; quit command and a status badge --- README.md | 4 ++++ main.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index b443abd..194f0f0 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ Then play the game: ``` The game will randomly-select a 5-letter word and you have unlimited guesses to get the word right. Each time you guess, if you have a letter that matches the same location as it is in the secret word, it will be revealed to you. However, any letter that does *not* match the secret word's letter at the same location will be displayed as `_`. Good luck! + +## Revisions: +Resolves ChicoState/Wordler#2 +Resolves ChicoState/Wordler#1 diff --git a/main.cpp b/main.cpp index 3d81b0a..d3b256d 100644 --- a/main.cpp +++ b/main.cpp @@ -24,6 +24,10 @@ int main(){ do{ do{ std::cin >> guess; + if(guess == "quit"){ + std::cout << "Thanks for playing!\n"; + return 0; + } }while( guess.length() != 5 ); // capitalize guess for easy comparisons