Skip to content

Instantly share code, notes, and snippets.

@edenizk
Created May 11, 2018 16:42
Show Gist options
  • Select an option

  • Save edenizk/609568f2a397e3baab35da798fbdf51b to your computer and use it in GitHub Desktop.

Select an option

Save edenizk/609568f2a397e3baab35da798fbdf51b to your computer and use it in GitHub Desktop.
turns screen to white
#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
void mena(){
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE);
int co=178;
for(int j=0;j<5;j++){
string s;
system("cls");
// s+="\t\t";
for(int k=0;k<48;k++){
s+=(char)co;
}
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t\t\t \t\t\t";
s+=(char)co;
s+="\n";
s+=(char)co;
if(j<2){
s+="\t\t ~THE BANNER~\t\t\t";
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t-by Ergin Deniz Kosecioglu (IT-eng)\t";
}
else
s+="\t \t\t\t";
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t\t\t\t\t\t";
s+=(char)co;
s+="\n";
for(int k=0;k<49;k++){
s+=(char)co;
}
if(j<3)
cout<<s;
else
system("cls");
co-=1;
Sleep(300);
}
}
/////////////////////////////////////
//////////////////////////////////////
void menu(){
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE);
char again;
int co=178;
for(int j=0;j<5;j++){
string s;
system("cls");
// s+="\t\t";
for(int k=0;k<48;k++){
s+=(char)co;
}
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t\t\t \t\t\t";
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t\t ~THE BANNER~\t\t\t";
s+=(char)co;
s+="\n";
s+=(char)co;
s+="\t\t\t\t\t\t";
s+=(char)co;
s+="\n";
for(int k=0;k<49;k++){
s+=(char)co;
}
cout<<s;
}
}
//////////////////////////////////////////
////////////////////////////////////////
char againsaver(char again)
{
if((again=='n')||(again=='N'))
{
return again='n';
}
else if((again=='y')||(again=='Y'))
{
return again='y';
}
else
{
cout<<"\t-Please write [y/Y] for continue, and [n/N] for exit : ";
cin>>again;
// system ("CLS");
if((again=='n')||(again=='N'))
{
return again='n';
}
else if((again=='y')||(again=='Y'))
{
return again='y';
}
else
{
cout<<"\t -You kicked :P";
return again='n';
}
// cout<<"asd";
}
}
//////////////////////////////////////////////
/////////////////////////////////////////////
int main(int argc, char** argv) {
HANDLE a = GetStdHandle(STD_OUTPUT_HANDLE);
char again;
do{
menu();
getch();
mena();
system ("pause");
SetConsoleTextAttribute(a, 240);
system("cls");
cout<<"========================================================================\n"
<<"|\t\t -BANNER "<<(char) 196<<" playing with colors "<<(char) 1<<"\t\t\t|\n"
<<"|\t\t\t -CDV(C)2018 student\t\t\t\t| \n"
<<"========================================================================\n";
system ("pause");
system("cls");
cout<<"\n\t-Do you wanna see it again ? [Y/N]\n";
again=getch();
again=againsaver(again);
if((again=='n')||(again=='N'))
{
cout<<"GOOD BYE "<<(char)1;
}
SetConsoleTextAttribute(a, 15);
}while((again=='y')||(again=='Y'));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment