├── word_game.cpp ├── Screenshots ├── gameplay.gif └── title_screen.jpg ├── Questions ├── 4 letter answers.txt ├── 5 letter answers.txt ├── 6 letter answers.txt ├── 7 letter answers.txt ├── 8 letter answers.txt ├── 9 letter answers.txt └── 10 letter answers.txt ├── main.cpp ├── LICENSE ├── README.md └── word_game.h /word_game.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/word_game.cpp -------------------------------------------------------------------------------- /Screenshots/gameplay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Screenshots/gameplay.gif -------------------------------------------------------------------------------- /Screenshots/title_screen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Screenshots/title_screen.jpg -------------------------------------------------------------------------------- /Questions/4 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/4 letter answers.txt -------------------------------------------------------------------------------- /Questions/5 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/5 letter answers.txt -------------------------------------------------------------------------------- /Questions/6 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/6 letter answers.txt -------------------------------------------------------------------------------- /Questions/7 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/7 letter answers.txt -------------------------------------------------------------------------------- /Questions/8 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/8 letter answers.txt -------------------------------------------------------------------------------- /Questions/9 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/9 letter answers.txt -------------------------------------------------------------------------------- /Questions/10 letter answers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arasgungore/Word-Game/HEAD/Questions/10 letter answers.txt -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "word_game.h" 2 | 3 | int main() { 4 | srand((unsigned int)time(NULL)); 5 | SetConsoleOutputCP(CP_TURKISH); 6 | SetConsoleCP(CP_TURKISH); 7 | WordGame AliIhsanVarol(GAME_TIME_IN_SECONDS/60, GAME_TIME_IN_SECONDS%60, BENJAMIN_TIME_IN_SECONDS/60, BENJAMIN_TIME_IN_SECONDS%60); 8 | AliIhsanVarol.Start(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Aras Güngöre 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Word-Game 2 | 3 | A C++ project in which you can play the most naive and elegant game show of the screens, Kelime Oyunu (Word Game), on the terminal. The Turkish question pool contains over 7,000 questions to help you boost your word power. 4 | 5 | 6 | 7 | ## Run on Terminal 8 | 9 | ```sh 10 | g++ word_game.cpp main.cpp -std=c++11 -o test 11 | test 12 | ``` 13 | 14 | 15 | 16 | ## Introduction 17 | 18 |

19 | Screenshot 20 |

21 | 22 | Welcome to Kelime Oyunu (Word Game)! 23 | 24 | 25 | ### Rules 26 | 27 | - You will try to guess a total of 14 words/phrases according to the definitions given in 4 minutes. 28 | Words/phrases will be presented to you one by one, and respectively they will have 4, 5, 6, 7, 8, 9, and 10 letters for each pair. 29 | 30 | - You will earn 100 points per letter from the words/phrases you guess correctly from these 14 words/phrases. 31 | (a total of 98 letters, which makes the highest possible score 9,800) 32 | 33 | - For help, you can reveal a letter of current the word/phrase by pressing the 'H' key; but you cannot get points from the revealed letters. 34 | You can stop the timer by pressing the 'B' key (Benjamin), but you cannot reveal any more letters after stopping the timer. 35 | 36 | - After the timer stops, you will have 30 seconds to guess the current word/phrase. If you cannot guess the word/phrase correctly within this time, 37 | you will be penalized 100 points per unrevealed letter of the word/phrase. 38 | 39 | - You can press the 'P' key to pause and the 'Escape' key to exit the game at any given time. 40 | 41 | Press any key to start the game. 42 | 43 | 44 | 45 | ## Gameplay 46 | 47 |

48 | Screenshot 49 |

50 | 51 | 52 | 53 | ## Author 54 | 55 | 👤 **Aras Güngöre** 56 | 57 | * LinkedIn: [@arasgungore](https://www.linkedin.com/in/arasgungore) 58 | * GitHub: [@arasgungore](https://github.com/arasgungore) 59 | -------------------------------------------------------------------------------- /word_game.h: -------------------------------------------------------------------------------- 1 | #ifndef WORD_GAME_H 2 | #define WORD_GAME_H 3 | 4 | #define CP_TURKISH 1254 5 | #define BENJAMIN 'B' 6 | #define HARF_ALAYIM 'H' 7 | #define PAUSE_KEY 'P' 8 | #define ESCAPE_KEY 27 9 | #define RESTART_KEY 'R' 10 | #define VIEW_RECORDS 'Y' 11 | #define GAME_TIME_IN_SECONDS 240 12 | #define BENJAMIN_TIME_IN_SECONDS 30 13 | #define MIN_NO_OF_LETTERS 4 14 | #define MAX_NO_OF_LETTERS 10 15 | #define NO_OF_ANSWERS_FOR_EACH_NO_OF_LETTERS 2 16 | #define POINTS_PER_LETTER 100 17 | 18 | class Timer; 19 | class WordGame; 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | // timer class declaration 28 | class Timer { 29 | private: 30 | short minutes; 31 | double seconds; 32 | public: 33 | Timer(const short &minutes, const double &seconds = 0.0); 34 | short GetMinutes() const; 35 | double GetSeconds() const; 36 | void SetTimer(const short &minutes, const double &seconds); 37 | void IncreaseTimer(const short &m_inc, const double &s_inc); 38 | bool UpdateTimer(const clock_t &before, const clock_t &after); 39 | void UpdateTimerDisplay(clock_t &begin, const clock_t &after, const short &x, const short &y) const; 40 | }; 41 | 42 | // Word Game class declaration 43 | class WordGame { 44 | private: 45 | int score = 0; 46 | unsigned short no_of_undisplayed_letters = MIN_NO_OF_LETTERS; 47 | std::string current_word, current_question, word_on_display; 48 | std::queue QandA; 49 | Timer current_time, benjamin; 50 | void Update(); 51 | void GetLetter(); 52 | void StopTime(clock_t &before1, clock_t &after1); 53 | void StopTimeUtil(clock_t &before, clock_t &after, clock_t &before1, clock_t &after1, const bool &guessed_correct); 54 | static void PrintOpeningScreen(); 55 | static void PrintLoadingScreen(); 56 | void PrintQandAScreen() const; 57 | void PrintEndGameScreen() const; 58 | void RecordScore(); 59 | void GetNextQuestion(); 60 | void DisplayAnswer(); 61 | void ReadQuestion(const unsigned short &no_of_letters); 62 | bool CompareAnswers(const std::string &guess) const; 63 | static char TR_toupper(const char &ch); 64 | public: 65 | WordGame(const short &minutes = 4, const double &seconds = 0.0, const short &benjamin_m = 0, const double &benjamin_s = 30.0); 66 | void Start(); 67 | }; 68 | 69 | // other function declarations 70 | void MoveCursorToXY(const short &x, const short &y); 71 | template T GetRandomNumber(const T &min, const T &max); 72 | 73 | #endif //KELIME_OYUNU_H 74 | --------------------------------------------------------------------------------