What's new
Guest viewing is limited

Design C++ Text Color

Pivetor

Establishing Talker
PF Member
Messages
47
Highlights
0
Reaction score
0
Points
42
Peak Coin
0.000000¢
DB Transfer
0.000000¢
Code:
C++ Syntax 
#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define MAGENTA 5
#define BROWN 6
#define LIGHTGREY 7
#define DARKGREY 8
#define LIGHTBLUE 9
#define LIGHTGREEN 10
#define LIGHTCYAN 11
#define LIGHTRED 12
#define LIGHTMAGENTA 13
#define YELLOW 14
#define WHITE 15
#define BLINK 128
HANDLE screen;
int textcolor = LIGHTGREEN;
int backgroundcolor = BLACK;
screen = GetStdHandle(STD_OUTPUT_HANDLE);
void TextColor(int fontcolor,int backgroundcolor,HANDLE screen)
{
int color_attribute;
color_attribute = backgroundcolor;
color_attribute = _rotl(color_attribute,4) | fontcolor;
SetConsoleTextAttribute(screen,color_attribute);
}

TextColor(textcolor,backgroundcolor ,screen); 
FillConsoleOutputAttribute(screen, _rotl(backgroundcolor,4) , 80 * 50,coord , &cWritten);


This works in Microsoft c++
 
It would be good if you take a screenshot of the output and add it here.
 
I would love to, but I do not have the program on my computer here, I simply remembered the code from school, and put it on here for people to show :)

It is more of a surprise I guess for them to know.
 
Loaded Baked Potato and Chicken Casserole

LOADED BAKED POTATO & CHICKEN CASSEROLE -
INGREDIENTS
2 lbs. chicken breasts, cubed or shredded
10-12 small red potatoes diced
1/2 cup olive oil
1 tsp. salt
1 TBS. freshly ground pepper
1/2 TBS. garlic powder
2 c. Mexican Blend Cheese (low fat for even healthier version)
1/2 c. crumbled bacon (delete for lower calorie version)
1/2 c. chopped green onion

DIRECTIONS
Preheat your oven to 475. In a large bowl, mix together olive oil, salt, pepper, garlic powder. Add the potatoes and coat with mixture. Place the potatoes into a greased baking dish, leave as much of the mix as possible. Bake potatoes for 1 hr. Flip the potatoes every 15-20 minutes. Check with a fork to ensure the potatoes are done. While the potatoes are baking, coat the chicken with the left over mixture and cook in a skillet over medium heat, until the chicken is done (no longer pink inside!) Once the potatoes are done, take them out of the oven and turn the oven temperature down to 400. Add the chicken, cheese, bacon & green onions. Put the casserole back in the oven and bake for 5 minutes or until cheese is melted. Can be served with low fat sour cream or ranch dressing -- optional)
 
Back
Top