So that we can critique it, of course :)
Notice that all of your <color> functions do almost exactly the same thing. This is the perfect opportunity to factor out the logic into a function with parameters.
Make a new function,
1 2 3 4
|
void show_credits(string title, string dev, int color)
{
// ...
}
| |
And have it be the same as, for example, your green function, but replace
FOREGROUND_GREEN with
color.
And then, your green function becomes:
1 2 3 4 5 6 7 8 9
|
void green(string TITLE, string DEV)
{
show_credits(TITLE, DEV, FOREGROUND_GREEN);
}
void red(string TITLE, string DEV)
{
show_credits(TITLE, DEV, FOREGROUND_RED);
}
| |
Another improvement is to see if you generate the text that you print in a more dynamic way to allow for a range of title/dev lengths.
Also, think about how you name your functions. A function like "red()" or "green()" doesn't tell me what it does. What is the purpose of the function? Try to encode the purpose of the function in its name in some way, for example "show_credits" like I did.
PS: ALLCAPS names are usually reserved to be easily identified as macros (and sometimes enums or constants). You can have all-caps, non-macro names, but it goes against most style guides and common practices.