Terminal Games
Simple games that run in the terminal.
Loading...
Searching...
No Matches
Globals.hpp
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <exception>
6#include <sstream>
7#include <string>
8#include <vector>
9
15{
20 namespace Exceptions
21 {
25 class QuitProgram : public std::exception
26 {
27 };
28
32 class QuitMainMenu : public std::exception
33 {
34 };
35
39 class QuitGame : public std::exception
40 {
41 };
42
46 class ResetGame : public std::exception
47 {
48 };
49
53 class RestartGame : public std::exception
54 {
55 };
56
60 class BackspaceKeyPressed : public std::exception
61 {
62 };
63
67 class NotImplementedError : public std::exception
68 {
69 };
70 }
71
85 template<typename T, typename U>
86 static constexpr T ImplementStdRangesFind(const T& p_begin, const T& p_end, const U& p_value)
87 {
88 for (T i = p_begin; i < p_end; i++)
89 {
90 if (*i == p_value)
91 {
92 return i;
93 }
94 }
95
96 return p_end;
97 }
98
111 template<typename T, typename U>
112 static constexpr int32_t ImplementStdCount(const T& p_begin, const T& p_end, const U& p_value)
113 {
114 int32_t count = 0;
115
116 for (T i = p_begin; i < p_end; i++)
117 {
118 if (*i == p_value)
119 {
120 ++count;
121 }
122 }
123
124 return count;
125 }
126
134 static std::string RepeatString(const uint32_t& p_numberOfRepetitions, const std::string& p_stringToRepeat)
135 {
136 std::ostringstream buffer;
137 for (uint32_t currentRepetition = 0; currentRepetition < p_numberOfRepetitions; currentRepetition++)
138 {
139 buffer << p_stringToRepeat;
140 }
141 return buffer.str();
142 }
143
150 static constexpr void RemoveSubString(std::string& p_string, const std::string& p_subString)
151 {
152 const uint32_t SUB_STRING_LENGTH = p_subString.size();
153 for (std::string::size_type currentSubStringLocation = p_string.find(p_subString); currentSubStringLocation != std::string::npos; currentSubStringLocation = p_string.find(p_subString))
154 {
155 p_string.erase(currentSubStringLocation, SUB_STRING_LENGTH);
156 }
157 }
158
163#ifdef _WIN32
164 static const inline bool G_PLATFORM_IS_WINDOWS = true;
165#else
166 static const inline bool G_PLATFORM_IS_WINDOWS = false;
167#endif
168
172 static inline const std::string G_MAIN_MENU_CLI_HELP_MESSAGE = "\nUsage: terminal-games [options]\n\nOPTIONS:\n\nGeneric Options:\n\n -h --help Display available options.\n\nOptional Options:\n\n --a --ascii-only Only use extended ASCII characters (this removes all colour).\n\n";
173
178 static inline const char G_PAGE_HORIZONTAL_LINE = static_cast<char>(205);
179 static inline const char G_PAGE_VERTICAL_LINE = static_cast<char>(186);
180 static inline const char G_PAGE_TOP_RIGHT_CORNER = static_cast<char>(187);
181 static inline const char G_PAGE_BOTTOM_RIGHT_CORNER = static_cast<char>(188);
182 static inline const char G_PAGE_BOTTOM_LEFT_CORNER = static_cast<char>(200);
183 static inline const char G_PAGE_TOP_LEFT_CORNER = static_cast<char>(201);
185
190 static inline const char G_PAGE_GRID_HORIZONTAL_LINE = static_cast<char>(196);
191 static inline const char G_PAGE_GRID_VERTICAL_LINE = static_cast<char>(179);
192 static inline const char G_PAGE_GRID_INTERSECTION = static_cast<char>(197);
193 static inline const char G_PAGE_GRID_UPSIDE_DOWN_T = static_cast<char>(193);
194 static inline const char G_PAGE_GRID_T = static_cast<char>(194);
195 static inline const char G_PAGE_GRID_LEFT_SIDEWAYS_T = static_cast<char>(195);
196 static inline const char G_PAGE_GRID_RIGHT_SIDEWAYS_T = static_cast<char>(180);
197 static inline const char G_PAGE_GRID_TOP_LEFT = static_cast<char>(218);
198 static inline const char G_PAGE_GRID_TOP_RIGHT = static_cast<char>(191);
199 static inline const char G_PAGE_GRID_BOTTOM_LEFT = static_cast<char>(192);
200 static inline const char G_PAGE_GRID_BOTTOM_RIGHT = static_cast<char>(217);
202
207 static inline const char G_PAGE_CENTRAL_DOT = static_cast<char>(250);
208 static inline const char G_PAGE_LIGHT_HASH = static_cast<char>(176);
209 static inline const char G_PAGE_DARK_HASH = static_cast<char>(178);
211
215
217 static inline const uint32_t G_PAGE_MINIMUM_LEFT_VERTICAL_LINE_SIZE = 1;
218 static inline const uint32_t G_PAGE_MINIMUM_LEFT_PADDING_SIZE = 1;
219 static inline const uint32_t G_PAGE_MINIMUM_RIGHT_PADDING_SIZE = 1;
220 static inline const uint32_t G_PAGE_MINIMUM_RIGHT_VERTICAL_LINE_SIZE = 1;
222
227 static inline const std::string G_PAGE_OPTION_SELECTOR = ">";
228 static inline const std::string G_PAGE_OPTION_SELECTOR_ABSENT_PADDING = std::string(Globals::G_PAGE_OPTION_SELECTOR.size() + 1, ' ');
230
235 static inline const uint32_t G_PAGE_ANSI_COLOUR_ESCAPE_CODE_COUNT = 6;
236 static inline const uint32_t G_PAGE_ANSI_COLOUR_ESCAPE_CODE_SIZE = 7;
237 static inline const char G_PAGE_ANSI_COLOUR_ESCAPE_CODE_START = '\x1B';
238 static inline const std::string G_PAGE_ANSI_WHITE_COLOUR_ESCAPE_CODE = "\x1B[1;37m";
239 static inline const std::string G_PAGE_ANSI_RED_COLOUR_ESCAPE_CODE = "\x1B[1;31m";
240 static inline const std::string G_PAGE_ANSI_BLUE_COLOUR_ESCAPE_CODE = "\x1B[1;34m";
241 static inline const std::string G_PAGE_ANSI_GREEN_COLOUR_ESCAPE_CODE = "\x1B[1;32m";
242 static inline const std::string G_PAGE_ANSI_YELLOW_COLOUR_ESCAPE_CODE = "\x1B[1;33m";
243 static inline const std::string G_PAGE_ANSI_RESET_COLOUR_ESCAPE_CODE = "\x1B[0m";
255
256
260 enum class Colours : std::uint8_t
261 {
266 WHITE = 0,
273 };
274
279 static inline const std::string G_HOMEPAGE_TOP_TITLE = "Terminal Games";
280 static inline const std::string G_HOMEPAGE_BOTTOM_TITLE = "q = quit program";
281 static inline const uint32_t G_HOMEPAGE_DISPLAY_WIDTH = 40;
282 static inline const uint32_t G_HOMEPAGE_DISPLAY_HEIGHT = 20;
284
289 static inline const std::string G_MAIN_MENU_TOP_TITLE = "Main Menu";
290 static inline const std::string G_MAIN_MENU_BOTTOM_TITLE = "q = quit to homepage";
291 static inline const uint32_t G_MAIN_MENU_DISPLAY_WIDTH = 32;
292 static inline const uint32_t G_MAIN_MENU_DISPLAY_HEIGHT = 13;
294
299 static inline const std::string G_TICTACTOE_TOP_TITLE = "Tic Tac Toe";
300 static inline const std::string G_TICTACTOE_BOTTOM_TITLE = "q = show quit menu";
301 static inline const uint32_t G_TICTACTOE_DISPLAY_WIDTH = 57;
302 static inline const uint32_t G_TICTACTOE_DISPLAY_HEIGHT = 19;
304
309 static inline const std::string G_HANGMAN_TOP_TITLE = "Hangman";
310 static inline const std::string G_HANGMAN_BOTTOM_TITLE = "q = show quit menu";
311 static inline const uint32_t G_HANGMAN_DISPLAY_WIDTH = 62;
312 static inline const uint32_t G_HANGMAN_DISPLAY_HEIGHT = 22;
314
319 static inline const std::string G_BATTLESHIPS_TOP_TITLE = "Battleships";
320 static inline const std::string G_BATTLESHIPS_BOTTOM_TITLE = "q = show quit menu";
321 static inline const uint32_t G_BATTLESHIPS_DISPLAY_WIDTH = 142;
322 static inline const uint32_t G_BATTLESHIPS_DISPLAY_HEIGHT = 38;
324
329 static inline const uint32_t G_QUIT_MENU_RESTART_GAME_INDEX = 0;
330 static inline const uint32_t G_QUIT_MENU_RESET_GAME_INDEX = 1;
331 static inline const uint32_t G_QUIT_MENU_QUIT_GAME_INDEX = 2;
332 static inline const uint32_t G_QUIT_MENU_QUIT_MAIN_MENU_INDEX = 3;
333 static inline const uint32_t G_QUIT_MENU_QUIT_PROGRAM_INDEX = 4;
334 static inline const uint32_t G_QUIT_MENU_CANCEL_INDEX = 5;
335 static inline const std::vector<std::string> G_QUIT_MENU_OPTIONS = {
336 "Restart Game",
337 "Reset Game",
338 "Quit to Main Menu",
339 "Quit to Homepage",
340 "Quit Program",
341 "Cancel",
342 };
343
344
349 static inline const uint32_t G_TERMINAL_ENTER_KEY = '\r';
350 static inline const uint32_t G_TERMINAL_BACKSPACE_KEY = 8;
351 static inline const uint32_t G_TERMINAL_UP_ARROW_KEY = 72;
352 static inline const uint32_t G_TERMINAL_DOWN_ARROW_KEY = 80;
353 static inline const uint32_t G_TERMINAL_LEFT_ARROW_KEY = 75;
354 static inline const uint32_t G_TERMINAL_RIGHT_ARROW_KEY = 77;
355 static inline const uint32_t G_TERMINAL_QUIT_KEY = 'q';
356 static inline const uint32_t G_TERMINAL_RESTART_KEY = 'r';
358
363 static inline const uint32_t G_TERMINAL_ALTERNATIVE_ENTER_KEY = 'e';
364 static inline const uint32_t G_TERMINAL_ALTERNATIVE_BACKSPACE_KEY = 'z';
365 static inline const uint32_t G_TERMINAL_ALTERNATIVE_UP_ARROW_KEY = 'w';
366 static inline const uint32_t G_TERMINAL_ALTERNATIVE_DOWN_ARROW_KEY = 's';
367 static inline const uint32_t G_TERMINAL_ALTERNATIVE_LEFT_ARROW_KEY = 'a';
368 static inline const uint32_t G_TERMINAL_ALTERNATIVE_RIGHT_ARROW_KEY = 'd';
370
374 static inline const uint32_t G_TERMINAL_CURSOR_WIDTH_PERCENTAGE = 100;
375
380 static inline const uint32_t G_GAME_TWO_OPTIONS = 2;
381 static inline const uint32_t G_GAME_THREE_OPTIONS = 3;
382 static inline const std::string G_GAME_UNKNOWN_OPTION = "N/A";
383 static inline const std::string G_GAME_NUMBER_OF_PLAYERS = "# of Players = ";
384 static inline const std::string G_GAME_COMPUTER_SPEED = "Computer Speed = ";
385 static inline const std::vector<std::string> G_GAME_COMPUTER_SPEED_OPTIONS = {"INSTANT", "FAST", "SLOW"};
386 static inline const std::vector<std::string> G_GAME_MAX_TWO_PLAYERS_OPTIONS = {"0", "1", "2"};
387 static inline const std::vector<std::string> G_GAME_MAX_ONE_PLAYER_OPTIONS = {"0", "1"};
389
394 static inline const uint32_t G_TICTACTOE_GRID_WIDTH = 3;
395 static inline const uint32_t G_TICTACTOE_GRID_HEIGHT = 3;
396 static inline const uint32_t G_TICTACTOE_GRID_ELEMENT_WIDTH = 3;
397 static inline const uint32_t G_TICTACTOE_GRID_ELEMENT_HEIGHT = 1;
398 static inline const uint32_t G_TICTACTOE_GRID_LEFT_PAD = 3;
399 static inline const uint32_t G_TICTACTOE_GRID_TOP_PAD = 4;
401
407 static inline const std::string G_TICTACTOE_EMPTY_GRID_VALUE = std::string(G_TICTACTOE_GRID_ELEMENT_WIDTH, ' ');
408 static inline const std::string G_TICTACTOE_GRID_PLAYER_X_OCCUPIED = " X ";
409 static inline const std::string G_TICTACTOE_GRID_PLAYER_O_OCCUPIED = " O ";
411
416
421 static inline const std::string G_TICTACTOE_PLAYER_X = "Player X";
422 static inline const std::string G_TICTACTOE_PLAYER_O = "Player O";
423 static inline const std::vector<std::string> G_TICTACTOE_PLAYER_CHOICE_OPTIONS = {G_TICTACTOE_PLAYER_X, G_TICTACTOE_PLAYER_O};
425
430 static inline const uint32_t G_HANGMAN_MINIMUM_WORD_SIZE = 3;
431 static inline const uint32_t G_HANGMAN_MAXIMUM_WORD_SIZE = 16;
433#
438 static inline const uint32_t G_HANGMAN_USER_INPUT_ROW = 13;
439 static inline const uint32_t G_HANGMAN_GET_WORD_FROM_USER_COLUMN = 39;
440 static inline const uint32_t G_HANGMAN_GET_USER_COMMAND_COLUMN = 41;
442
446 static inline const uint32_t G_HANGMAN_KEY_PRESS_CHAR_OFFSET = 32;
447
451 static inline const uint32_t G_HANGMAN_MAXIMUM_ERROR_COUNT = 10;
452
457 static inline const uint32_t G_HANGMAN_GALLOWS_BASE_WIDTH = 7;
458 static inline const uint32_t G_HANGMAN_GALLOWS_BASE_WIDTH_HALF = 3;
462 static inline const std::string G_HANGMAN_GALLOWS_VERTICAL_BEAM = " " + std::string(1, Globals::G_PAGE_GRID_VERTICAL_LINE);
465 static inline const std::string G_HANGMAN_GALLOWS_TOP_BEAM_INITIAL = " " + std::string(1, Globals::G_PAGE_GRID_TOP_LEFT) + std::string(G_HANGMAN_GALLOWS_BASE_WIDTH, G_PAGE_GRID_HORIZONTAL_LINE) + " ";
467 static inline const char G_HANGMAN_HIDDEN_LETTER = '_';
468
473 static inline const std::vector<std::vector<std::string>> G_HANGMAN_STATES = {
474 {
475 "",
476 "",
477 "",
478 "",
479 "",
480 "",
481 "",
482 },
483 {
484 "",
485 "",
486 "",
487 "",
488 "",
489 "",
491 },
492 {
493 "",
500 },
501 {
509 },
510 {
518 },
519 {
527 },
528 {
536 },
537 {
545 },
546 {
554 },
555 {
563 },
564 {
572 }
573 };
574
575 static inline const std::string G_HANGMAN_INCORRECT_GUESSES_TITLE = "Incorrect Guesses";
576 static inline const std::string G_HANGMAN_INCORRECT_GUESSES_PADDING = " ";
579
580 static inline const std::string G_HANGMAN_WORD_TO_BE_GUESSED_START = "(The word was ";
581 static inline const std::string G_HANGMAN_WORD_TO_BE_GUESSED_END = ")";
583
588 static inline const std::string G_HANGMAN_GUESSER = "GUESSER";
589 static inline const std::string G_HANGMAN_WORD_SETTER = "WORD SETTER";
590 static inline const std::vector<std::string> G_HANGMAN_PLAYER_CHOICE_OPTIONS = {G_HANGMAN_GUESSER, G_HANGMAN_WORD_SETTER};
592
597 static inline const uint32_t G_HANGMAN_NUMBER_OF_COMPUTER_WORDS = 972;
598 static inline const std::array<std::string, G_HANGMAN_NUMBER_OF_COMPUTER_WORDS> G_HANGMAN_COMPUTER_WORDS = {
599 "ABILITY",
600 "ABLE",
601 "ABOUT",
602 "ABOVE",
603 "ACCEPT",
604 "ACCORDING",
605 "ACCOUNT",
606 "ACROSS",
607 "ACT",
608 "ACTION",
609 "ACTIVITY",
610 "ACTUALLY",
611 "ADD",
612 "ADDRESS",
613 "ADMINISTRATION",
614 "ADMIT",
615 "ADULT",
616 "AFFECT",
617 "AFTER",
618 "AGAIN",
619 "AGAINST",
620 "AGE",
621 "AGENCY",
622 "AGENT",
623 "AGO",
624 "AGREE",
625 "AGREEMENT",
626 "AHEAD",
627 "AIR",
628 "ALL",
629 "ALLOW",
630 "ALMOST",
631 "ALONE",
632 "ALONG",
633 "ALREADY",
634 "ALSO",
635 "ALTHOUGH",
636 "ALWAYS",
637 "AMERICAN",
638 "AMONG",
639 "AMOUNT",
640 "ANALYSIS",
641 "AND",
642 "ANIMAL",
643 "ANOTHER",
644 "ANSWER",
645 "ANY",
646 "ANYONE",
647 "ANYTHING",
648 "APPEAR",
649 "APPLY",
650 "APPROACH",
651 "AREA",
652 "ARGUE",
653 "ARM",
654 "AROUND",
655 "ARRIVE",
656 "ART",
657 "ARTICLE",
658 "ARTIST",
659 "ASK",
660 "ASSUME",
661 "ATTACK",
662 "ATTENTION",
663 "ATTORNEY",
664 "AUDIENCE",
665 "AUTHOR",
666 "AUTHORITY",
667 "AVAILABLE",
668 "AVOID",
669 "AWAY",
670 "BABY",
671 "BACK",
672 "BAD",
673 "BAG",
674 "BALL",
675 "BANK",
676 "BAR",
677 "BASE",
678 "BEAT",
679 "BEAUTIFUL",
680 "BECAUSE",
681 "BECOME",
682 "BED",
683 "BEFORE",
684 "BEGIN",
685 "BEHAVIOUR",
686 "BEHIND",
687 "BELIEVE",
688 "BENEFIT",
689 "BEST",
690 "BETTER",
691 "BETWEEN",
692 "BEYOND",
693 "BIG",
694 "BILL",
695 "BILLION",
696 "BIT",
697 "BLACK",
698 "BLOOD",
699 "BLUE",
700 "BOARD",
701 "BODY",
702 "BOOK",
703 "BORN",
704 "BOTH",
705 "BOX",
706 "BOY",
707 "BREAK",
708 "BRING",
709 "BROTHER",
710 "BUDGET",
711 "BUILD",
712 "BUILDING",
713 "BUSINESS",
714 "BUT",
715 "BUY",
716 "CALL",
717 "CAMERA",
718 "CAMPAIGN",
719 "CAN",
720 "CANCER",
721 "CANDIDATE",
722 "CAPITAL",
723 "CAR",
724 "CARD",
725 "CARE",
726 "CAREER",
727 "CARRY",
728 "CASE",
729 "CATCH",
730 "CAUSE",
731 "CELL",
732 "CENTER",
733 "CENTRAL",
734 "CENTURY",
735 "CERTAIN",
736 "CERTAINLY",
737 "CHAIR",
738 "CHALLENGE",
739 "CHANCE",
740 "CHANGE",
741 "CHARACTER",
742 "CHARGE",
743 "CHECK",
744 "CHILD",
745 "CHOICE",
746 "CHOOSE",
747 "CHURCH",
748 "CITIZEN",
749 "CITY",
750 "CIVIL",
751 "CLAIM",
752 "CLASS",
753 "CLEAR",
754 "CLEARLY",
755 "CLOSE",
756 "COACH",
757 "COLD",
758 "COLLECTION",
759 "COLLEGE",
760 "COLOUR",
761 "COME",
762 "COMMERCIAL",
763 "COMMON",
764 "COMMUNITY",
765 "COMPANY",
766 "COMPARE",
767 "COMPUTER",
768 "CONCERN",
769 "CONDITION",
770 "CONFERENCE",
771 "CONGRESS",
772 "CONSIDER",
773 "CONSUMER",
774 "CONTAIN",
775 "CONTINUE",
776 "CONTROL",
777 "COST",
778 "COULD",
779 "COUNTRY",
780 "COUPLE",
781 "COURSE",
782 "COURT",
783 "COVER",
784 "CREATE",
785 "CRIME",
786 "CULTURAL",
787 "CULTURE",
788 "CUP",
789 "CURRENT",
790 "CUSTOMER",
791 "CUT",
792 "DARK",
793 "DATA",
794 "DAUGHTER",
795 "DAY",
796 "DEAD",
797 "DEAL",
798 "DEATH",
799 "DEBATE",
800 "DECADE",
801 "DECIDE",
802 "DECISION",
803 "DEEP",
804 "DEFENCE",
805 "DEGREE",
806 "DEMOCRAT",
807 "DEMOCRATIC",
808 "DESCRIBE",
809 "DESIGN",
810 "DESPITE",
811 "DETAIL",
812 "DETERMINE",
813 "DEVELOP",
814 "DEVELOPMENT",
815 "DIE",
816 "DIFFERENCE",
817 "DIFFERENT",
818 "DIFFICULT",
819 "DINNER",
820 "DIRECTION",
821 "DIRECTOR",
822 "DISCOVER",
823 "DISCUSS",
824 "DISCUSSION",
825 "DISEASE",
826 "DOCTOR",
827 "DOG",
828 "DOOR",
829 "DOWN",
830 "DRAW",
831 "DREAM",
832 "DRIVE",
833 "DROP",
834 "DRUG",
835 "DURING",
836 "EACH",
837 "EARLY",
838 "EAST",
839 "EASY",
840 "EAT",
841 "ECONOMIC",
842 "ECONOMY",
843 "EDGE",
844 "EDUCATION",
845 "EFFECT",
846 "EFFORT",
847 "EIGHT",
848 "EITHER",
849 "ELECTION",
850 "ELSE",
851 "EMPLOYEE",
852 "END",
853 "ENERGY",
854 "ENJOY",
855 "ENOUGH",
856 "ENTER",
857 "ENTIRE",
858 "ENVIRONMENT",
859 "ENVIRONMENTAL",
860 "ESPECIALLY",
861 "ESTABLISH",
862 "EVEN",
863 "EVENING",
864 "EVENT",
865 "EVER",
866 "EVERY",
867 "EVERYBODY",
868 "EVERYONE",
869 "EVERYTHING",
870 "EVIDENCE",
871 "EXACTLY",
872 "EXAMPLE",
873 "EXECUTIVE",
874 "EXIST",
875 "EXPECT",
876 "EXPERIENCE",
877 "EXPERT",
878 "EXPLAIN",
879 "EYE",
880 "FACE",
881 "FACT",
882 "FACTOR",
883 "FAIL",
884 "FALL",
885 "FAMILY",
886 "FAR",
887 "FAST",
888 "FATHER",
889 "FEAR",
890 "FEDERAL",
891 "FEEL",
892 "FEELING",
893 "FEW",
894 "FIELD",
895 "FIGHT",
896 "FIGURE",
897 "FILL",
898 "FILM",
899 "FINAL",
900 "FINALLY",
901 "FINANCIAL",
902 "FIND",
903 "FINE",
904 "FINGER",
905 "FINISH",
906 "FIRE",
907 "FIRM",
908 "FIRST",
909 "FISH",
910 "FIVE",
911 "FLOOR",
912 "FLY",
913 "FOCUS",
914 "FOLLOW",
915 "FOOD",
916 "FOOT",
917 "FOR",
918 "FORCE",
919 "FOREIGN",
920 "FORGET",
921 "FORM",
922 "FORMER",
923 "FORWARD",
924 "FOUR",
925 "FREE",
926 "FRIEND",
927 "FROM",
928 "FRONT",
929 "FULL",
930 "FUND",
931 "FUTURE",
932 "GAME",
933 "GARDEN",
934 "GAS",
935 "GENERAL",
936 "GENERATION",
937 "GET",
938 "GIRL",
939 "GIVE",
940 "GLASS",
941 "GOAL",
942 "GOOD",
943 "GOVERNMENT",
944 "GREAT",
945 "GREEN",
946 "GROUND",
947 "GROUP",
948 "GROW",
949 "GROWTH",
950 "GUESS",
951 "GUN",
952 "GUY",
953 "HAIR",
954 "HALF",
955 "HAND",
956 "HANG",
957 "HAPPEN",
958 "HAPPY",
959 "HARD",
960 "HAVE",
961 "HEAD",
962 "HEALTH",
963 "HEAR",
964 "HEART",
965 "HEAT",
966 "HEAVY",
967 "HELP",
968 "HER",
969 "HERE",
970 "HERSELF",
971 "HIGH",
972 "HIM",
973 "HIMSELF",
974 "HIS",
975 "HISTORY",
976 "HIT",
977 "HOLD",
978 "HOME",
979 "HOPE",
980 "HOSPITAL",
981 "HOT",
982 "HOTEL",
983 "HOUR",
984 "HOUSE",
985 "HOW",
986 "HOWEVER",
987 "HUGE",
988 "HUMAN",
989 "HUNDRED",
990 "HUSBAND",
991 "IDEA",
992 "IDENTIFY",
993 "IMAGE",
994 "IMAGINE",
995 "IMPACT",
996 "IMPORTANT",
997 "IMPROVE",
998 "INCLUDE",
999 "INCLUDING",
1000 "INCREASE",
1001 "INDEED",
1002 "INDICATE",
1003 "INDIVIDUAL",
1004 "INDUSTRY",
1005 "INFORMATION",
1006 "INSIDE",
1007 "INSTEAD",
1008 "INSTITUTION",
1009 "INTEREST",
1010 "INTERESTING",
1011 "INTERNATIONAL",
1012 "INTERVIEW",
1013 "INTO",
1014 "INVESTMENT",
1015 "INVOLVE",
1016 "ISSUE",
1017 "ITEM",
1018 "ITS",
1019 "ITSELF",
1020 "JOB",
1021 "JOIN",
1022 "JUST",
1023 "KEEP",
1024 "KEY",
1025 "KID",
1026 "KILL",
1027 "KIND",
1028 "KITCHEN",
1029 "KNOW",
1030 "KNOWLEDGE",
1031 "LAND",
1032 "LANGUAGE",
1033 "LARGE",
1034 "LAST",
1035 "LATE",
1036 "LATER",
1037 "LAUGH",
1038 "LAW",
1039 "LAWYER",
1040 "LAY",
1041 "LEAD",
1042 "LEADER",
1043 "LEARN",
1044 "LEAST",
1045 "LEAVE",
1046 "LEFT",
1047 "LEG",
1048 "LEGAL",
1049 "LESS",
1050 "LET",
1051 "LETTER",
1052 "LEVEL",
1053 "LIE",
1054 "LIFE",
1055 "LIGHT",
1056 "LIKE",
1057 "LIKELY",
1058 "LINE",
1059 "LIST",
1060 "LISTEN",
1061 "LITTLE",
1062 "LIVE",
1063 "LOCAL",
1064 "LONG",
1065 "LOOK",
1066 "LOSE",
1067 "LOSS",
1068 "LOT",
1069 "LOVE",
1070 "LOW",
1071 "MACHINE",
1072 "MAGAZINE",
1073 "MAIN",
1074 "MAINTAIN",
1075 "MAJOR",
1076 "MAJORITY",
1077 "MAKE",
1078 "MAN",
1079 "MANAGE",
1080 "MANAGEMENT",
1081 "MANAGER",
1082 "MANY",
1083 "MARKET",
1084 "MARRIAGE",
1085 "MATERIAL",
1086 "MATTER",
1087 "MAY",
1088 "MAYBE",
1089 "MEAN",
1090 "MEASURE",
1091 "MEDIA",
1092 "MEDICAL",
1093 "MEET",
1094 "MEETING",
1095 "MEMBER",
1096 "MEMORY",
1097 "MENTION",
1098 "MESSAGE",
1099 "METHOD",
1100 "MIDDLE",
1101 "MIGHT",
1102 "MILITARY",
1103 "MILLION",
1104 "MIND",
1105 "MINUTE",
1106 "MISS",
1107 "MISSION",
1108 "MODEL",
1109 "MODERN",
1110 "MOMENT",
1111 "MONEY",
1112 "MONTH",
1113 "MORE",
1114 "MORNING",
1115 "MOST",
1116 "MOTHER",
1117 "MOUTH",
1118 "MOVE",
1119 "MOVEMENT",
1120 "MOVIE",
1121 "MRS",
1122 "MUCH",
1123 "MUSIC",
1124 "MUST",
1125 "MYSELF",
1126 "NAME",
1127 "NATION",
1128 "NATIONAL",
1129 "NATURAL",
1130 "NATURE",
1131 "NEAR",
1132 "NEARLY",
1133 "NECESSARY",
1134 "NEED",
1135 "NETWORK",
1136 "NEVER",
1137 "NEW",
1138 "NEWS",
1139 "NEWSPAPER",
1140 "NEXT",
1141 "NICE",
1142 "NIGHT",
1143 "NONE",
1144 "NOR",
1145 "NORTH",
1146 "NOT",
1147 "NOTE",
1148 "NOTHING",
1149 "NOTICE",
1150 "NOW",
1151 "N'T",
1152 "NUMBER",
1153 "OCCUR",
1154 "OFF",
1155 "OFFER",
1156 "OFFICE",
1157 "OFFICER",
1158 "OFFICIAL",
1159 "OFTEN",
1160 "OIL",
1161 "OLD",
1162 "ONCE",
1163 "ONE",
1164 "ONLY",
1165 "ONTO",
1166 "OPEN",
1167 "OPERATION",
1168 "OPPORTUNITY",
1169 "OPTION",
1170 "ORDER",
1171 "ORGANIZATION",
1172 "OTHER",
1173 "OTHERS",
1174 "OUR",
1175 "OUT",
1176 "OUTSIDE",
1177 "OVER",
1178 "OWN",
1179 "OWNER",
1180 "PAGE",
1181 "PAIN",
1182 "PAINTING",
1183 "PAPER",
1184 "PARENT",
1185 "PART",
1186 "PARTICIPANT",
1187 "PARTICULAR",
1188 "PARTICULARLY",
1189 "PARTNER",
1190 "PARTY",
1191 "PASS",
1192 "PAST",
1193 "PATIENT",
1194 "PATTERN",
1195 "PAY",
1196 "PEACE",
1197 "PEOPLE",
1198 "PER",
1199 "PERFORM",
1200 "PERFORMANCE",
1201 "PERHAPS",
1202 "PERIOD",
1203 "PERSON",
1204 "PERSONAL",
1205 "PHONE",
1206 "PHYSICAL",
1207 "PICK",
1208 "PICTURE",
1209 "PIECE",
1210 "PLACE",
1211 "PLAN",
1212 "PLANT",
1213 "PLAY",
1214 "PLAYER",
1215 "POINT",
1216 "POLICE",
1217 "POLICY",
1218 "POLITICAL",
1219 "POLITICS",
1220 "POOR",
1221 "POPULAR",
1222 "POPULATION",
1223 "POSITION",
1224 "POSITIVE",
1225 "POSSIBLE",
1226 "POWER",
1227 "PRACTICE",
1228 "PREPARE",
1229 "PRESENT",
1230 "PRESIDENT",
1231 "PRESSURE",
1232 "PRETTY",
1233 "PREVENT",
1234 "PRICE",
1235 "PRIVATE",
1236 "PROBABLY",
1237 "PROBLEM",
1238 "PROCESS",
1239 "PRODUCE",
1240 "PRODUCT",
1241 "PRODUCTION",
1242 "PROFESSIONAL",
1243 "PROFESSOR",
1244 "PROGRAM",
1245 "PROJECT",
1246 "PROPERTY",
1247 "PROTECT",
1248 "PROVE",
1249 "PROVIDE",
1250 "PUBLIC",
1251 "PULL",
1252 "PURPOSE",
1253 "PUSH",
1254 "PUT",
1255 "QUALITY",
1256 "QUESTION",
1257 "QUICKLY",
1258 "QUITE",
1259 "RACE",
1260 "RADIO",
1261 "RAISE",
1262 "RANGE",
1263 "RATE",
1264 "RATHER",
1265 "REACH",
1266 "READ",
1267 "READY",
1268 "REAL",
1269 "REALITY",
1270 "REALIZE",
1271 "REALLY",
1272 "REASON",
1273 "RECEIVE",
1274 "RECENT",
1275 "RECENTLY",
1276 "RECOGNIZE",
1277 "RECORD",
1278 "RED",
1279 "REDUCE",
1280 "REFLECT",
1281 "REGION",
1282 "RELATE",
1283 "RELATIONSHIP",
1284 "RELIGIOUS",
1285 "REMAIN",
1286 "REMEMBER",
1287 "REMOVE",
1288 "REPORT",
1289 "REPRESENT",
1290 "REPUBLICAN",
1291 "REQUIRE",
1292 "RESEARCH",
1293 "RESOURCE",
1294 "RESPOND",
1295 "RESPONSE",
1296 "RESPONSIBILITY",
1297 "REST",
1298 "RESULT",
1299 "RETURN",
1300 "REVEAL",
1301 "RICH",
1302 "RIGHT",
1303 "RISE",
1304 "RISK",
1305 "ROAD",
1306 "ROCK",
1307 "ROLE",
1308 "ROOM",
1309 "RULE",
1310 "RUN",
1311 "SAFE",
1312 "SAME",
1313 "SAVE",
1314 "SAY",
1315 "SCENE",
1316 "SCHOOL",
1317 "SCIENCE",
1318 "SCIENTIST",
1319 "SCORE",
1320 "SEA",
1321 "SEASON",
1322 "SEAT",
1323 "SECOND",
1324 "SECTION",
1325 "SECURITY",
1326 "SEE",
1327 "SEEK",
1328 "SEEM",
1329 "SELL",
1330 "SEND",
1331 "SENIOR",
1332 "SENSE",
1333 "SERIES",
1334 "SERIOUS",
1335 "SERVE",
1336 "SERVICE",
1337 "SET",
1338 "SEVEN",
1339 "SEVERAL",
1340 "SHAKE",
1341 "SHARE",
1342 "SHE",
1343 "SHOOT",
1344 "SHORT",
1345 "SHOT",
1346 "SHOULD",
1347 "SHOULDER",
1348 "SHOW",
1349 "SIDE",
1350 "SIGN",
1351 "SIGNIFICANT",
1352 "SIMILAR",
1353 "SIMPLE",
1354 "SIMPLY",
1355 "SINCE",
1356 "SING",
1357 "SINGLE",
1358 "SISTER",
1359 "SIT",
1360 "SITE",
1361 "SITUATION",
1362 "SIX",
1363 "SIZE",
1364 "SKILL",
1365 "SKIN",
1366 "SMALL",
1367 "SMILE",
1368 "SOCIAL",
1369 "SOCIETY",
1370 "SOLDIER",
1371 "SOME",
1372 "SOMEBODY",
1373 "SOMEONE",
1374 "SOMETHING",
1375 "SOMETIMES",
1376 "SON",
1377 "SONG",
1378 "SOON",
1379 "SORT",
1380 "SOUND",
1381 "SOURCE",
1382 "SOUTH",
1383 "SOUTHERN",
1384 "SPACE",
1385 "SPEAK",
1386 "SPECIAL",
1387 "SPECIFIC",
1388 "SPEECH",
1389 "SPEND",
1390 "SPORT",
1391 "SPRING",
1392 "STAFF",
1393 "STAGE",
1394 "STAND",
1395 "STANDARD",
1396 "STAR",
1397 "START",
1398 "STATE",
1399 "STATEMENT",
1400 "STATION",
1401 "STAY",
1402 "STEP",
1403 "STILL",
1404 "STOCK",
1405 "STOP",
1406 "STORE",
1407 "STORY",
1408 "STRATEGY",
1409 "STREET",
1410 "STRONG",
1411 "STRUCTURE",
1412 "STUDENT",
1413 "STUDY",
1414 "STUFF",
1415 "STYLE",
1416 "SUBJECT",
1417 "SUCCESS",
1418 "SUCCESSFUL",
1419 "SUCH",
1420 "SUDDENLY",
1421 "SUFFER",
1422 "SUGGEST",
1423 "SUMMER",
1424 "SUPPORT",
1425 "SURE",
1426 "SURFACE",
1427 "SYSTEM",
1428 "TABLE",
1429 "TAKE",
1430 "TALK",
1431 "TASK",
1432 "TAX",
1433 "TEACH",
1434 "TEACHER",
1435 "TEAM",
1436 "TECHNOLOGY",
1437 "TELEVISION",
1438 "TELL",
1439 "TEN",
1440 "TEND",
1441 "TERM",
1442 "TEST",
1443 "THAN",
1444 "THANK",
1445 "THAT",
1446 "THE",
1447 "THEIR",
1448 "THEM",
1449 "THEMSELVES",
1450 "THEN",
1451 "THEORY",
1452 "THERE",
1453 "THESE",
1454 "THEY",
1455 "THING",
1456 "THINK",
1457 "THIRD",
1458 "THIS",
1459 "THOSE",
1460 "THOUGH",
1461 "THOUGHT",
1462 "THOUSAND",
1463 "THREAT",
1464 "THREE",
1465 "THROUGH",
1466 "THROUGHOUT",
1467 "THROW",
1468 "THUS",
1469 "TIME",
1470 "TODAY",
1471 "TOGETHER",
1472 "TONIGHT",
1473 "TOO",
1474 "TOP",
1475 "TOTAL",
1476 "TOUGH",
1477 "TOWARD",
1478 "TOWN",
1479 "TRADE",
1480 "TRADITIONAL",
1481 "TRAINING",
1482 "TRAVEL",
1483 "TREAT",
1484 "TREATMENT",
1485 "TREE",
1486 "TRIAL",
1487 "TRIP",
1488 "TROUBLE",
1489 "TRUE",
1490 "TRUTH",
1491 "TRY",
1492 "TURN",
1493 "TWO",
1494 "TYPE",
1495 "UNDER",
1496 "UNDERSTAND",
1497 "UNIT",
1498 "UNTIL",
1499 "UPON",
1500 "USE",
1501 "USUALLY",
1502 "VALUE",
1503 "VARIOUS",
1504 "VERY",
1505 "VICTIM",
1506 "VIEW",
1507 "VIOLENCE",
1508 "VISIT",
1509 "VOICE",
1510 "VOTE",
1511 "WAIT",
1512 "WALK",
1513 "WALL",
1514 "WANT",
1515 "WAR",
1516 "WATCH",
1517 "WATER",
1518 "WAY",
1519 "WEAPON",
1520 "WEAR",
1521 "WEEK",
1522 "WEIGHT",
1523 "WELL",
1524 "WEST",
1525 "WESTERN",
1526 "WHAT",
1527 "WHATEVER",
1528 "WHEN",
1529 "WHERE",
1530 "WHETHER",
1531 "WHICH",
1532 "WHILE",
1533 "WHITE",
1534 "WHO",
1535 "WHOLE",
1536 "WHOM",
1537 "WHOSE",
1538 "WHY",
1539 "WIDE",
1540 "WIFE",
1541 "WILL",
1542 "WIN",
1543 "WIND",
1544 "WINDOW",
1545 "WISH",
1546 "WITH",
1547 "WITHIN",
1548 "WITHOUT",
1549 "WOMAN",
1550 "WONDER",
1551 "WORD",
1552 "WORK",
1553 "WORKER",
1554 "WORLD",
1555 "WORRY",
1556 "WOULD",
1557 "WRITE",
1558 "WRITER",
1559 "WRONG",
1560 "YARD",
1561 "YEAH",
1562 "YEAR",
1563 "YES",
1564 "YET",
1565 "YOU",
1566 "YOUNG",
1567 "YOUR",
1568 "YOURSELF",
1569 };
1570
1571
1576 static inline const uint32_t G_BATTLESHIPS_BOARD_WIDTH = 10;
1577 static inline const uint32_t G_BATTLESHIPS_BOARD_HEIGHT = 10;
1578 static inline const uint32_t G_BATTLESHIPS_GRID_ELEMENT_WIDTH = 3;
1579 static inline const uint32_t G_BATTLESHIPS_GRID_ELEMENT_HEIGHT = 1;
1580 static inline const uint32_t G_BATTLESHIPS_GRID_PLAYER_ONE_BOARD_LEFT_PAD = 8;
1581 static inline const uint32_t G_BATTLESHIPS_GRID_PLAYER_TWO_BOARD_LEFT_PAD = 101;
1582 static inline const uint32_t G_BATTLESHIPS_GRID_TOP_PAD = 8;
1584
1590
1593
1596
1599
1603
1604 static inline const uint32_t G_BATTLESHIPS_LETTER_OFFSET = 65;
1606
1611 static inline const std::string G_BATTLESHIPS_EMPTY_GRID_VALUE = std::string(G_BATTLESHIPS_GRID_ELEMENT_WIDTH, ' ');
1612 static inline const std::string G_BATTLESHIPS_MISSED_ATTACK = std::string(1, ' ') + G_PAGE_CENTRAL_DOT + ' ';
1616
1621 static inline const std::string G_BATTLESHIPS_PLAYER_ONE = "Player One";
1622 static inline const std::string G_BATTLESHIPS_PLAYER_TWO = "Player Two";
1623 static inline const std::array<std::string, G_GAME_TWO_OPTIONS> G_BATTLESHIPS_PLAYER_CHOICE_OPTIONS = {G_BATTLESHIPS_PLAYER_ONE, G_BATTLESHIPS_PLAYER_TWO};
1625
1629 static inline const uint32_t G_BATTLESHIPS_SHIP_COUNT = 5;
1630
1635 static inline const uint32_t G_BATTLESHIPS_CARRIER_SIZE = 5;
1636 static inline const uint32_t G_BATTLESHIPS_BATTLESHIP_SIZE = 4;
1637 static inline const uint32_t G_BATTLESHIPS_DESTROYER_SIZE = 3;
1638 static inline const uint32_t G_BATTLESHIPS_SUBMARINE_SIZE = 3;
1639 static inline const uint32_t G_BATTLESHIPS_PATROL_BOAT_SIZE = 2;
1640
1641 static inline const std::string G_BATTLESHIPS_CARRIER_NAME = "Carrier";
1642 static inline const std::string G_BATTLESHIPS_BATTLESHIP_NAME = "Battleship";
1643 static inline const std::string G_BATTLESHIPS_DESTROYER_NAME = "Destroyer";
1644 static inline const std::string G_BATTLESHIPS_SUBMARINE_NAME = "Submarine";
1645 static inline const std::string G_BATTLESHIPS_PATROL_BOAT_NAME = "Patrol Boat";
1646
1653
1657 static inline const std::array<std::string, G_BATTLESHIPS_SHIP_COUNT> G_BATTLESHIPS_SHIP_INSTRUCTIONS = {
1658 "Please enter the " + std::to_string(G_BATTLESHIPS_CARRIER_SIZE) + " grid locations for the Carrier",
1659 "Please enter the " + std::to_string(G_BATTLESHIPS_BATTLESHIP_SIZE) + " grid locations for the Battleship",
1660 "Please enter the " + std::to_string(G_BATTLESHIPS_DESTROYER_SIZE) + " grid locations for the Destroyer",
1661 "Please enter the " + std::to_string(G_BATTLESHIPS_SUBMARINE_SIZE) + " grid locations for the Submarine",
1662 "Please enter the " + std::to_string(G_BATTLESHIPS_PATROL_BOAT_SIZE) + " grid locations for the Patrol Boat",
1663 };
1664
1668 static inline const std::array<std::string, G_BATTLESHIPS_SHIP_COUNT> G_BATTLESHIPS_SHIP_NAMES = {
1674 };
1675
1686
1690 static inline const std::array<uint32_t, G_BATTLESHIPS_SHIP_COUNT> G_BATTLESHIPS_SHIP_SIZES = {
1696 };
1697}
Used when the backspace key is pressed.
Definition Globals.hpp:61
Used for functionality that has not been implemented.
Definition Globals.hpp:68
Used to reset a game which prompts the user for new options.
Definition Globals.hpp:47
Used to restart a game with the same user options.
Definition Globals.hpp:54
Contains all custom exceptions.
Contains all global and constant objects.
static const uint32_t G_HANGMAN_KEY_PRESS_CHAR_OFFSET
Hangman value to minus from key press to get char representation.
Definition Globals.hpp:446
static const std::string G_TICTACTOE_GRID_ROW_VALUE_DIVIDER
TicTacToe grid values.
Definition Globals.hpp:406
static const std::vector< std::string > G_QUIT_MENU_OPTIONS
Quit menu options.
Definition Globals.hpp:335
static const uint32_t G_BATTLESHIPS_SHIP_COUNT
Battleships number of ships for each board/player.
Definition Globals.hpp:1629
static const std::array< std::string, G_BATTLESHIPS_SHIP_COUNT > G_BATTLESHIPS_SHIP_PLACED_NAMES
Battleships list of ship names when placed on a board.
Definition Globals.hpp:1679
static const std::string G_PAGE_ANSI_RED_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:239
static const uint32_t G_BATTLESHIPS_SUBMARINE_SIZE
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1638
static const std::array< std::string, G_HANGMAN_NUMBER_OF_COMPUTER_WORDS > G_HANGMAN_COMPUTER_WORDS
Hangman computer word list for when the computer is asked to chose a word to be guessed.
Definition Globals.hpp:598
static const std::string G_TICTACTOE_TOP_TITLE
Page attributes for all TicTacToe pages.
Definition Globals.hpp:299
static const uint32_t G_BATTLESHIPS_GRID_ELEMENT_HEIGHT
Battleships board attributes.
Definition Globals.hpp:1579
static const uint32_t G_TERMINAL_ALTERNATIVE_DOWN_ARROW_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:366
static const std::string G_BATTLESHIPS_TOP_TITLE
Page attributes for all Battleships pages.
Definition Globals.hpp:319
static const char G_PAGE_ANSI_COLOUR_ESCAPE_CODE_START
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:237
static const std::string G_TICTACTOE_GRID_PLAYER_X_OCCUPIED
TicTacToe grid values.
Definition Globals.hpp:408
static const std::string G_TICTACTOE_GRID_PLAYER_O_OCCUPIED
TicTacToe grid values.
Definition Globals.hpp:409
static const uint32_t G_TERMINAL_ALTERNATIVE_LEFT_ARROW_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:367
static constexpr T ImplementStdRangesFind(const T &p_begin, const T &p_end, const U &p_value)
Implements std::ranges::find which should work for all standard template library containers.
Definition Globals.hpp:86
static const uint32_t G_MAIN_MENU_DISPLAY_HEIGHT
Page attributes for the MainMenu page.
Definition Globals.hpp:292
static const bool G_PLATFORM_IS_WINDOWS
Used by PageBuilder to display the current platform being used and used by Terminal to decided whethe...
Definition Globals.hpp:166
static const uint32_t G_BATTLESHIPS_DISPLAY_WIDTH
Page attributes for all Battleships pages.
Definition Globals.hpp:321
static const uint32_t G_QUIT_MENU_QUIT_GAME_INDEX
Quit menu options.
Definition Globals.hpp:331
static const uint32_t G_QUIT_MENU_QUIT_PROGRAM_INDEX
Quit menu options.
Definition Globals.hpp:333
static const std::string G_HANGMAN_GALLOWS_VERTICAL_BEAM_WITH_ROPE
Hangman constants used to construct the hangman.
Definition Globals.hpp:464
static const uint32_t G_PAGE_ANSI_COLOUR_ESCAPE_CODE_COUNT
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:235
static const uint32_t G_BATTLESHIPS_GRID_TOP_PAD
Battleships board attributes.
Definition Globals.hpp:1582
static const uint32_t G_HANGMAN_GET_WORD_FROM_USER_COLUMN
Hangman cursor position when getting user input on Windows.
Definition Globals.hpp:439
static const uint32_t G_HANGMAN_MAXIMUM_WORD_SIZE
Hangman word to be guessed constraints.
Definition Globals.hpp:431
static const char G_PAGE_BOTTOM_RIGHT_CORNER
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:181
static const uint32_t G_HANGMAN_DISPLAY_WIDTH
Page attributes for all Hangman pages.
Definition Globals.hpp:311
static const std::array< std::string, G_PAGE_ANSI_COLOUR_ESCAPE_CODE_COUNT > G_PAGE_ANSI_ALL_COLOUR_ESCAPE_CODES
Definition Globals.hpp:247
static const uint32_t G_HANGMAN_GET_USER_COMMAND_COLUMN
Hangman cursor position when getting user input on Windows.
Definition Globals.hpp:440
static const char G_PAGE_LIGHT_HASH
Misc extended ASCII characters.
Definition Globals.hpp:208
static const char G_PAGE_GRID_TOP_RIGHT
Extended ASCII characters for grids.
Definition Globals.hpp:198
static const uint32_t G_TERMINAL_ENTER_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:349
static const char G_PAGE_GRID_TOP_LEFT
Extended ASCII characters for grids.
Definition Globals.hpp:197
static const std::string G_HANGMAN_GUESSER
Hangman player choice options.
Definition Globals.hpp:588
static const std::string G_BATTLESHIPS_SUCCESSFUL_ATTACK
Battleships board values.
Definition Globals.hpp:1614
static const std::string G_PAGE_ANSI_BLUE_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:240
static const std::string G_HANGMAN_WORD_TO_BE_GUESSED_END
Hangman constants used to construct the hangman.
Definition Globals.hpp:581
static const uint32_t G_TERMINAL_RIGHT_ARROW_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:354
static const std::string G_HANGMAN_GALLOWS_VERTICAL_BEAM_WITH_PADDING
Hangman constants used to construct the hangman.
Definition Globals.hpp:463
static const std::string G_HANGMAN_GALLOWS_VERTICAL_BEAM
Hangman constants used to construct the hangman.
Definition Globals.hpp:462
static const std::string G_BATTLESHIPS_GRID_BOTTOM_LINE_BOTTOM_LEFT
Battleships board constants used to construct the board.
Definition Globals.hpp:1597
static const std::string G_HANGMAN_WORD_TO_BE_GUESSED_START
Hangman constants used to construct the hangman.
Definition Globals.hpp:580
static const std::string G_BATTLESHIPS_MISSED_ATTACK
Battleships board values.
Definition Globals.hpp:1612
static const std::string G_BATTLESHIPS_GRID_MIDDLE_LINE_MIDDLE
Battleships board constants used to construct the board.
Definition Globals.hpp:1595
static const std::string G_HOMEPAGE_BOTTOM_TITLE
Page attributes for the homepage.
Definition Globals.hpp:280
static const std::string G_BATTLESHIPS_GRID_BOTTOM_LINE_MIDDLE
Battleships board constants used to construct the board.
Definition Globals.hpp:1598
static const std::string G_BATTLESHIPS_GRID_MIDDLE_LINE
Battleships board constants used to construct the board.
Definition Globals.hpp:1601
static const char G_PAGE_VERTICAL_LINE
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:179
static const uint32_t G_BATTLESHIPS_BOARD_WIDTH
Battleships board attributes.
Definition Globals.hpp:1576
static const std::vector< std::string > G_GAME_MAX_TWO_PLAYERS_OPTIONS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:386
static const std::string G_PAGE_ANSI_YELLOW_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:242
static const uint32_t G_TICTACTOE_GRID_WIDTH
TicTacToe grid attributes.
Definition Globals.hpp:394
static const std::string G_PAGE_OPTION_SELECTOR
For when highlighting what is currently selected in an option menu.
Definition Globals.hpp:227
static const std::string G_BATTLESHIPS_DESTROYER_PLACED_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1649
static const uint32_t G_QUIT_MENU_QUIT_MAIN_MENU_INDEX
Quit menu options.
Definition Globals.hpp:332
static const char G_PAGE_GRID_VERTICAL_LINE
Extended ASCII characters for grids.
Definition Globals.hpp:191
static const char G_PAGE_DARK_HASH
Misc extended ASCII characters.
Definition Globals.hpp:209
static const std::string G_BATTLESHIPS_BATTLESHIP_PLACED_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1648
static const uint32_t G_TERMINAL_ALTERNATIVE_RIGHT_ARROW_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:368
static const std::string G_BATTLESHIPS_PATROL_BOAT_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1645
static const std::string G_BATTLESHIPS_BOTTOM_TITLE
Page attributes for all Battleships pages.
Definition Globals.hpp:320
static const char G_PAGE_CENTRAL_DOT
Misc extended ASCII characters.
Definition Globals.hpp:207
static const uint32_t G_TERMINAL_CURSOR_WIDTH_PERCENTAGE
The cursor width while running on windows.
Definition Globals.hpp:374
static const uint32_t G_TICTACTOE_DISPLAY_WIDTH
Page attributes for all TicTacToe pages.
Definition Globals.hpp:301
static const uint32_t G_PAGE_ANSI_COLOUR_ESCAPE_CODE_SIZE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:236
static const std::array< std::string, G_GAME_TWO_OPTIONS > G_BATTLESHIPS_PLAYER_CHOICE_OPTIONS
Battleships player choice options.
Definition Globals.hpp:1623
static const char G_PAGE_GRID_UPSIDE_DOWN_T
Extended ASCII characters for grids.
Definition Globals.hpp:193
static const uint32_t G_TICTACTOE_GRID_ELEMENT_HEIGHT
TicTacToe grid attributes.
Definition Globals.hpp:397
static const std::string G_TICTACTOE_EMPTY_GRID_VALUE
TicTacToe grid values.
Definition Globals.hpp:407
static const std::string G_HANGMAN_BOTTOM_TITLE
Page attributes for all Hangman pages.
Definition Globals.hpp:310
static const std::string G_HANGMAN_TOP_TITLE
Page attributes for all Hangman pages.
Definition Globals.hpp:309
static const uint32_t G_PAGE_MINIMUM_RIGHT_PADDING_SIZE
Minimum padding amounts.
Definition Globals.hpp:219
static const uint32_t G_TERMINAL_ALTERNATIVE_BACKSPACE_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:364
static const std::string G_MAIN_MENU_BOTTOM_TITLE
Page attributes for the MainMenu page.
Definition Globals.hpp:290
static const std::string G_BATTLESHIPS_PLAYER_ONE
Battleships player choice options.
Definition Globals.hpp:1621
static const std::string G_BATTLESHIPS_GRID_ITEM_HORIZONTAL_LINE
Battleships board constants used to construct the board.
Definition Globals.hpp:1589
static const uint32_t G_MAIN_MENU_DISPLAY_WIDTH
Page attributes for the MainMenu page.
Definition Globals.hpp:291
static const uint32_t G_BATTLESHIPS_PATROL_BOAT_SIZE
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1639
static const char G_PAGE_GRID_T
Extended ASCII characters for grids.
Definition Globals.hpp:194
static const std::string G_BATTLESHIPS_GRID_TOP_LINE
Battleships board constants used to construct the board.
Definition Globals.hpp:1600
static const uint32_t G_TICTACTOE_GRID_LEFT_PAD
TicTacToe grid attributes.
Definition Globals.hpp:398
static const uint32_t G_HANGMAN_GALLOWS_BASE_WIDTH
Hangman constants used to construct the hangman.
Definition Globals.hpp:457
static const std::string G_HANGMAN_GALLOWS_BASE_HALF
Hangman constants used to construct the hangman.
Definition Globals.hpp:460
static const uint32_t G_TICTACTOE_DISPLAY_HEIGHT
Page attributes for all TicTacToe pages.
Definition Globals.hpp:302
static const std::string G_HANGMAN_INCORRECT_GUESSES_PADDING
Hangman constants used to construct the hangman.
Definition Globals.hpp:576
static const uint32_t G_TERMINAL_LEFT_ARROW_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:353
static const uint32_t G_BATTLESHIPS_GRID_ELEMENT_WIDTH
Battleships board attributes.
Definition Globals.hpp:1578
static const char G_PAGE_GRID_LEFT_SIDEWAYS_T
Extended ASCII characters for grids.
Definition Globals.hpp:195
static std::string RepeatString(const uint32_t &p_numberOfRepetitions, const std::string &p_stringToRepeat)
Repeats p_stringToRepeat for a total of p_numberOfRepetitions number of times.
Definition Globals.hpp:134
static const uint32_t G_TICTACTOE_GRID_TOP_PAD
TicTacToe grid attributes.
Definition Globals.hpp:399
static const char G_PAGE_HORIZONTAL_LINE
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:178
static const uint32_t G_QUIT_MENU_RESTART_GAME_INDEX
Quit menu options.
Definition Globals.hpp:329
static const char G_PAGE_GRID_HORIZONTAL_LINE
Extended ASCII characters for grids.
Definition Globals.hpp:190
static const uint32_t G_BATTLESHIPS_BATTLESHIP_SIZE
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1636
static const std::string G_PAGE_ANSI_GREEN_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:241
static const std::string G_HANGMAN_INCORRECT_GUESSES_TITLE
Hangman constants used to construct the hangman.
Definition Globals.hpp:575
static const uint32_t G_TERMINAL_UP_ARROW_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:351
static const std::string G_BATTLESHIPS_GRID_MIDDLE_LINE_LEFT
Battleships board constants used to construct the board.
Definition Globals.hpp:1594
static const uint32_t G_HANGMAN_MAXIMUM_ERROR_COUNT
Hangman maximum errors count to determine whether the game is over.
Definition Globals.hpp:451
static const std::string G_BATTLESHIPS_PLAYER_TWO
Battleships player choice options.
Definition Globals.hpp:1622
static const uint32_t G_QUIT_MENU_CANCEL_INDEX
Quit menu options.
Definition Globals.hpp:334
static const std::string G_PAGE_ANSI_WHITE_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:238
static const std::string G_GAME_NUMBER_OF_PLAYERS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:383
static const std::vector< std::string > G_TICTACTOE_PLAYER_CHOICE_OPTIONS
TicTacToe player choice options.
Definition Globals.hpp:423
static const std::vector< std::vector< std::string > > G_HANGMAN_STATES
Hangman constants used to display the current state of the Hangman game.
Definition Globals.hpp:473
static const std::string G_GAME_COMPUTER_SPEED
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:384
static const uint32_t G_BATTLESHIPS_LETTER_OFFSET
Battleships board constants used to construct the board.
Definition Globals.hpp:1604
static const std::string G_TICTACTOE_PLAYER_X
TicTacToe player choice options.
Definition Globals.hpp:421
static const std::string G_BATTLESHIPS_BATTLESHIP_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1642
static const uint32_t G_BATTLESHIPS_DESTROYER_SIZE
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1637
static const uint32_t G_TERMINAL_ALTERNATIVE_UP_ARROW_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:365
static const std::string G_HANGMAN_GALLOWS_BASE
Hangman constants used to construct the hangman.
Definition Globals.hpp:461
static const uint32_t G_HANGMAN_USER_INPUT_ROW
Hangman cursor position when getting user input on Windows.
Definition Globals.hpp:438
static const uint32_t G_QUIT_MENU_RESET_GAME_INDEX
Quit menu options.
Definition Globals.hpp:330
static const std::string G_BATTLESHIPS_DESTROYER_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1643
static const std::string G_MAIN_MENU_TOP_TITLE
Page attributes for the MainMenu page.
Definition Globals.hpp:289
static const uint32_t G_TICTACTOE_MAXIMUM_ERROR_COUNT
TicTacToe maximum errors count to determine whether the game is over.
Definition Globals.hpp:415
static const std::string G_BATTLESHIPS_SHIP_PRESENT
Battleships board values.
Definition Globals.hpp:1613
static const uint32_t G_PAGE_MINIMUM_RIGHT_VERTICAL_LINE_SIZE
Minimum padding amounts.
Definition Globals.hpp:220
static const uint32_t G_BATTLESHIPS_CARRIER_SIZE
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1635
static const uint32_t G_BATTLESHIPS_GRID_PLAYER_ONE_BOARD_LEFT_PAD
Battleships board attributes.
Definition Globals.hpp:1580
Colours
Colours representing ANSI escape codes.
Definition Globals.hpp:261
@ BLUE
Supported ANSI escape colour.
Definition Globals.hpp:268
@ YELLOW
Supported ANSI escape colour.
Definition Globals.hpp:270
@ GREEN
Supported ANSI escape colour.
Definition Globals.hpp:269
@ RED
Supported ANSI escape colour.
Definition Globals.hpp:267
@ RESET
Supported ANSI escape colour.
Definition Globals.hpp:271
@ WHITE
Supported ANSI escape colour.
Definition Globals.hpp:266
static const std::string G_HANGMAN_WORD_SETTER
Hangman player choice options.
Definition Globals.hpp:589
static const char G_PAGE_GRID_BOTTOM_LEFT
Extended ASCII characters for grids.
Definition Globals.hpp:199
static const char G_PAGE_GRID_INTERSECTION
Extended ASCII characters for grids.
Definition Globals.hpp:192
static const uint32_t G_TICTACTOE_GRID_ELEMENT_WIDTH
TicTacToe grid attributes.
Definition Globals.hpp:396
static const std::string G_TICTACTOE_BOTTOM_TITLE
Page attributes for all TicTacToe pages.
Definition Globals.hpp:300
static const uint32_t G_BATTLESHIPS_GRID_PLAYER_TWO_BOARD_LEFT_PAD
Battleships board attributes.
Definition Globals.hpp:1581
static const uint32_t G_GAME_TWO_OPTIONS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:380
static const uint32_t G_HANGMAN_GALLOWS_BASE_WIDTH_HALF
Hangman constants used to construct the hangman.
Definition Globals.hpp:458
static const std::string G_BATTLESHIPS_GRID_TOP_LINE_MIDDLE
Battleships board constants used to construct the board.
Definition Globals.hpp:1592
static const std::string G_BATTLESHIPS_EMPTY_GRID_VALUE
Battleships board values.
Definition Globals.hpp:1611
static const char G_PAGE_TOP_LEFT_CORNER
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:183
static const char G_PAGE_BOTTOM_LEFT_CORNER
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:182
static const uint32_t G_PAGE_MINIMUM_LEFT_PADDING_SIZE
Minimum padding amounts.
Definition Globals.hpp:218
static const std::string G_BATTLESHIPS_PATROL_BOAT_PLACED_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1651
static const uint32_t G_HANGMAN_INCORRECT_GUESSES_FIRST_LINE_LAST_INDEX
Hangman constants used to construct the hangman.
Definition Globals.hpp:577
static const std::string G_TICTACTOE_PLAYER_O
TicTacToe player choice options.
Definition Globals.hpp:422
static const std::string G_HANGMAN_GALLOWS_TOP_BEAM
Hangman constants used to construct the hangman.
Definition Globals.hpp:466
static const std::vector< std::string > G_GAME_COMPUTER_SPEED_OPTIONS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:385
static const std::vector< std::string > G_HANGMAN_PLAYER_CHOICE_OPTIONS
Hangman player choice options.
Definition Globals.hpp:590
static const uint32_t G_TERMINAL_RESTART_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:356
static const uint32_t G_GAME_THREE_OPTIONS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:381
static const std::string G_BATTLESHIPS_SUBMARINE_PLACED_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1650
static const std::string G_PAGE_ANSI_RESET_COLOUR_ESCAPE_CODE
ANSI colour escape codes to add colour to output.
Definition Globals.hpp:243
static const std::string G_MAIN_MENU_CLI_HELP_MESSAGE
CLI help message.
Definition Globals.hpp:172
static const uint32_t G_TERMINAL_DOWN_ARROW_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:352
static const uint32_t G_HANGMAN_DISPLAY_HEIGHT
Page attributes for all Hangman pages.
Definition Globals.hpp:312
static const uint32_t G_TERMINAL_BACKSPACE_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:350
static const std::string G_HANGMAN_GALLOWS_BASE_INITIAL
Hangman constants used to construct the hangman.
Definition Globals.hpp:459
static const std::string G_BATTLESHIPS_GRID_TOP_LINE_TOP_LEFT
Battleships board constants used to construct the board.
Definition Globals.hpp:1591
static const uint32_t G_BATTLESHIPS_DISPLAY_HEIGHT
Page attributes for all Battleships pages.
Definition Globals.hpp:322
static const uint32_t G_HANGMAN_NUMBER_OF_COMPUTER_WORDS
Hangman computer word list for when the computer is asked to chose a word to be guessed.
Definition Globals.hpp:597
static const uint32_t G_HOMEPAGE_DISPLAY_HEIGHT
Page attributes for the homepage.
Definition Globals.hpp:282
static const std::string G_PAGE_OPTION_SELECTOR_ABSENT_PADDING
For when highlighting what is currently selected in an option menu.
Definition Globals.hpp:228
static const std::vector< std::string > G_GAME_MAX_ONE_PLAYER_OPTIONS
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:387
static const std::string G_HOMEPAGE_TOP_TITLE
Page attributes for the homepage.
Definition Globals.hpp:279
static const uint32_t G_HOMEPAGE_DISPLAY_WIDTH
Page attributes for the homepage.
Definition Globals.hpp:281
static const std::string G_BATTLESHIPS_SUBMARINE_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1644
static const char G_PAGE_GRID_RIGHT_SIDEWAYS_T
Extended ASCII characters for grids.
Definition Globals.hpp:196
static const uint32_t G_TERMINAL_ALTERNATIVE_ENTER_KEY
Keyboard values when getting user input other platforms.
Definition Globals.hpp:363
static const std::array< std::string, G_BATTLESHIPS_SHIP_COUNT > G_BATTLESHIPS_SHIP_NAMES
Battleships list of ship names.
Definition Globals.hpp:1668
static constexpr void RemoveSubString(std::string &p_string, const std::string &p_subString)
Removes in-place all instances of a p_subString from p_string .
Definition Globals.hpp:150
static const uint32_t G_HANGMAN_MINIMUM_WORD_SIZE
Hangman word to be guessed constraints.
Definition Globals.hpp:430
static constexpr int32_t ImplementStdCount(const T &p_begin, const T &p_end, const U &p_value)
Implements std::count which it should work for all standard template library containers.
Definition Globals.hpp:112
static const std::string G_BATTLESHIPS_GRID_BOTTOM_LINE
Battleships board constants used to construct the board.
Definition Globals.hpp:1602
static const uint32_t G_PAGE_MINIMUM_LEFT_VERTICAL_LINE_SIZE
Minimum padding amounts.
Definition Globals.hpp:217
static const char G_HANGMAN_HIDDEN_LETTER
Hangman constants used to construct the hangman.
Definition Globals.hpp:467
static const std::array< std::string, G_BATTLESHIPS_SHIP_COUNT > G_BATTLESHIPS_SHIP_INSTRUCTIONS
Battleships list of instructions use when asking the user for the grid locations for their ships.
Definition Globals.hpp:1657
static const std::string G_HANGMAN_GALLOWS_TOP_BEAM_INITIAL
Hangman constants used to construct the hangman.
Definition Globals.hpp:465
static const uint32_t G_TERMINAL_QUIT_KEY
Keyboard values when getting user input on Windows.
Definition Globals.hpp:355
static const char G_PAGE_TOP_RIGHT_CORNER
Extended ASCII characters for edges and corners of the page.
Definition Globals.hpp:180
static const std::array< uint32_t, G_BATTLESHIPS_SHIP_COUNT > G_BATTLESHIPS_SHIP_SIZES
Battleships list of ship sizes.
Definition Globals.hpp:1690
static const uint32_t G_BATTLESHIPS_BOARD_HEIGHT
Battleships board attributes.
Definition Globals.hpp:1577
static const uint32_t G_TICTACTOE_GRID_HEIGHT
TicTacToe grid attributes.
Definition Globals.hpp:395
static const uint32_t G_HANGMAN_INCORRECT_GUESSES_SECOND_LINE_LAST_INDEX
Hangman constants used to construct the hangman.
Definition Globals.hpp:578
static const std::string G_BATTLESHIPS_CARRIER_PLACED_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1647
static const char G_PAGE_GRID_BOTTOM_RIGHT
Extended ASCII characters for grids.
Definition Globals.hpp:200
static const std::string G_GAME_UNKNOWN_OPTION
Used by multiple games or an attribute not specific to one game.
Definition Globals.hpp:382
static const std::string G_BATTLESHIPS_CARRIER_NAME
Battleships ship-related constants used in later arrays.
Definition Globals.hpp:1641