int main() { printxy(10); printxy(20); std::cout << std::string("foo") * 25 << std::endl; std::cout << "foo"_s * 15 << std::endl; }
void CauHinhMenu() { textcolor(TRANG); printxy(30,6,"Chon cau hinh ban muon : "); printxy(30,7,"10 x 10 - 20 Bom"); printxy(30,8,"16 x 16 - 40 Bom"); printxy(30,9,"20 x 20 - 200 Bom"); printxy(30,10,"Nhap vao"); }
void MainMenu() { textcolor(TRANG); printxy(33,6,"Van moi"); printxy(33,7,"Choi tiep"); printxy(33,8,"Xem diem"); printxy(33,9,"Xem luat choi"); printxy(33,10,"Thoat"); }
void HDSD() { drawBoard(1,30,78,36,30,"Huong dan",10); textcolor(TRANG); printxy(2,31,"Su dung chuot trai de chon va chuot phai de danh dau"); printxy(2,32,"Su dung cac phim mui ten de di chuyen va : "); printxy(2,33,"X : mo o C : danh dau"); printxy(2,34,"Z : lam noi nhung o xung quanh A : mo nhung o xung quanh"); printxy(2,35,"S : Luu ESC : Thoat R : Quay lai man hinh chinh"); }
void lamnoi2(int y) { CauHinhMenu(); SetBGColor(XAM_SANG); textcolor(FOREGROUND_RED|FOREGROUND_INTENSITY); switch (y) { case 7:printxy(30,7,"10 x 10 - 20 Bom");break; case 8:printxy(30,8,"16 x 16 - 40 Bom");break; case 9:printxy(30,9,"20 x 20 - 200 Bom");break; case 10:printxy(30,10,"Nhap vao");break; } textcolor(TRANG); SetBGColor(DEN); }
int _tmain(int argc, _TCHAR* argv[]) { for(int i=0;i<25;i++) { printxy(i-1,2,' '); printxy(i,2,'o'); if(i==24) { printxy(i,1,'o'); } Sleep(500); } return 0; }
void lamnoi1(int y) { MainMenu(); SetBGColor(XAM_SANG); textcolor(FOREGROUND_RED|FOREGROUND_INTENSITY); switch (y) { case 6:printxy(33,6,"Van moi");break; case 7:printxy(33,7,"Choi tiep");break; case 8:printxy(33,8,"Xem diem");break; case 9:printxy(33,9,"xem luat choi");break; case 10:printxy(33,10,"Thoat");break; } textcolor(TRANG); SetBGColor(DEN); }
void Add(void){ char opt; fa=fopen("acc.dat","ab"); clrscr(); Temp1(); gotoxy(19,8); scanf(" "); gets(rec.rno); gotoxy(19,10); scanf(" "); gets(rec.nm); gotoxy(19,12); scanf(" "); gets(rec.snm); gotoxy(19,14); rec.mi=getche(); rec.mi=toupper(record.mi); gotoxy(19,16); rec.ccode=getche(); rec.ccode=toupper(rec.ccode); gotoxy(5,22); clreol(); printxy(79,22,"º"); fprintf(fp,"%s %s %s %c%c",rec.snum,rec.fname,rec.sname,rec.mi,rec.ccode); gotoxy(5,21); clreol(); center(21,"Record successfully added!"); printxy(79,21,"º"); gotoxy(53,22); delay(1000); center(22,"Press any key to go to main menu..."); getch(); fclose(fa); }
void MyRect::Draw() { for(int y = m_y; y < (m_y + m_height); y++) { for(int x = m_x; x < (m_x + m_width); x++) { printxy(x, y, '*'); } printf("\n"); } }
void MyRectangle::Draw() { for( int x = m_x + 0 ; x < m_x + m_width ; x = x + 1 ) { printxy( x , 0 , '0' + c); Sleep(30); } c = c + 1; MyRectangle::~MyRectangle(void) { }
void azulClaro(){ textbackground(LIGHT_BLUE); printxy(16, 15, " "); printxy(16, 16, " ###### "); printxy(16, 17, " # # "); printxy(16, 18, " # "); printxy(16, 19, " # "); printxy(16, 20, " # "); printxy(16, 21, " "); }
void verdeClaro(){ textbackground(LIGHT_GREEN); printxy(32, 15, " "); printxy(32, 16, " #### "); printxy(32, 17, " # # "); printxy(32, 18, " #### "); printxy(32, 19, " # # "); printxy(32, 20, " #### "); printxy(32, 21, " "); }
void branco(){ textbackground(WHITE); printxy(32, 8, " "); printxy(32, 9, " ###### "); printxy(32, 10, " # "); printxy(32, 11, " ##### "); printxy(32, 12, " # "); printxy(32, 13, " ##### "); printxy(32, 14, " "); }
void amarelo(){ textbackground(YELLOW); printxy(48, 1, " "); printxy(48, 2, " ###### "); printxy(48, 3, " # "); printxy(48, 4, " #### "); printxy(48, 5, " # "); printxy(48, 6, " ###### "); printxy(48, 7, " "); }
void vermelho(){ textbackground(RED); printxy(16, 8, " "); printxy(16, 9, " # # "); printxy(16, 10, " # # "); printxy(16, 11, " ###### "); printxy(16, 12, " # "); printxy(16, 13, " # "); printxy(16, 14, " "); }
void verde(){ textbackground(GREEN); printxy(32, 1, " "); printxy(32, 2, " ##### "); printxy(32, 3, " # "); printxy(32, 4, " ##### "); printxy(32, 5, " # "); printxy(32, 6, " ##### "); printxy(32, 7, " "); }
void magentaClaro(){ textbackground(LIGHT_MAGENTA); printxy(48, 15, " "); printxy(48, 16, " #### "); printxy(48, 17, " # # "); printxy(48, 18, " ##### "); printxy(48, 19, " # "); printxy(48, 20, " #### "); printxy(48, 21, " "); }
void azul(){ textbackground(BLUE); printxy(16, 1, " "); printxy(16, 2, " # "); printxy(16, 3, " ## "); printxy(16, 4, " # "); printxy(16, 5, " # "); printxy(16, 6, " ##### "); printxy(16, 7, " "); }
void marrom(){ textbackground(BROWN); printxy(48, 8, " "); printxy(48, 9, " #### "); printxy(48, 10, " # "); printxy(48, 11, " ##### "); printxy(48, 12, " # # "); printxy(48, 13, " #### "); printxy(48, 14, " "); }
void piscaMarrom(){ textbackground(BLACK); Beep(1400,500); printxy(48, 8, " "); printxy(48, 9, " "); printxy(48, 10, " "); printxy(48, 11, " "); printxy(48, 12, " "); printxy(48, 13, " "); printxy(48, 14, " "); wait(0.5); marrom(); }
void piscaVermelho(){ textbackground(BLACK); Beep(1000,500); printxy(16, 8, " "); printxy(16, 9, " "); printxy(16, 10, " "); printxy(16, 11, " "); printxy(16, 12, " "); printxy(16, 13, " "); printxy(16, 14, " "); wait(0.5); vermelho(); }
void piscaVerdeClaro(){ textbackground(BLACK); Beep(1800,500); printxy(32, 15, " "); printxy(32, 16, " "); printxy(32, 17, " "); printxy(32, 18, " "); printxy(32, 19, " "); printxy(32, 20, " "); printxy(32, 21, " "); wait(0.5); verdeClaro(); }
void piscaAzulClaro(){ textbackground(BLACK); Beep(1600,500); printxy(16, 15, " "); printxy(16, 16, " "); printxy(16, 17, " "); printxy(16, 18, " "); printxy(16, 19, " "); printxy(16, 20, " "); printxy(16, 21, " "); wait(0.5); azulClaro(); }
void piscaMagentaClaro(){ textbackground(BLACK); Beep(2000,500); printxy(48, 15, " "); printxy(48, 16, " "); printxy(48, 17, " "); printxy(48, 18, " "); printxy(48, 19, " "); printxy(48, 20, " "); printxy(48, 21, " "); wait(0.5); magentaClaro(); }
void piscaBranco(){ textbackground(BLACK); Beep(1200,500); printxy(32, 8, " "); printxy(32, 9, " "); printxy(32, 10, " "); printxy(32, 11, " "); printxy(32, 12, " "); printxy(32, 13, " "); printxy(32, 14, " "); wait(0.5); branco(); }
void piscaAzul(){ textbackground(BLACK); Beep(400,500); printxy(16, 1, " "); printxy(16, 2, " "); printxy(16, 3, " "); printxy(16, 4, " "); printxy(16, 5, " "); printxy(16, 6, " "); printxy(16, 7, " "); wait(0.5); azul(); }
void piscaVerde(){ textbackground(BLACK); Beep(600,500); printxy(32, 1, " "); printxy(32, 2, " "); printxy(32, 3, " "); printxy(32, 4, " "); printxy(32, 5, " "); printxy(32, 6, " "); printxy(32, 7, " "); wait(0.5); verde(); }
void piscaAmarelo(){ textbackground(BLACK); Beep(800,500); printxy(48, 1, " "); printxy(48, 2, " "); printxy(48, 3, " "); printxy(48, 4, " "); printxy(48, 5, " "); printxy(48, 6, " "); printxy(48, 7, " "); wait(0.5); amarelo(); }
/// Tiskne do default_screenu void printxyd(int y, int x, char * s){ printxy(default_screen, y, x, s); }
int main(){ int retorno = 1, pontuacao = 0, escolha; printxy(16, 9, "Vamos comecar a Jogar o SUPER GENIUS?"); printxy(16, 11, "Se acha que esta preparado aperte 1 e ENTER"); printxy(16, 12, "Se nao outro numero e ENTER: "); scanf("%i", &escolha); system("cls"); while(escolha!=1){ printxy(16, 9, "Que medo e esse? Aperta 1 e ENTER logo! "); scanf("%i", &escolha); if (escolha == 1){ printxy(16, 11, "Boa escolha, bora jogar!"); wait(2.0); } } system("cls"); while(retorno==1){ azul(); amarelo(); verde(); branco(); vermelho(); marrom(); azulClaro(); verdeClaro(); magentaClaro(); //setas(); int nivel=1, aleatorio, cor; int vetor[nivel-1], i, j, sair=0; do{ srand(time(NULL)); aleatorio = rand() % 9; //antes era 4 vetor[nivel-1] = aleatorio; for(i=0; i<9; i++){ wait(0.5); if(vetor[i]==1){ piscaAzul(); } if(vetor[i]==2){ piscaVerde(); } if(vetor[i]==3){ piscaAmarelo(); } if(vetor[i]==4){ piscaVermelho(); } if(vetor[i]==5){ piscaBranco(); } if(vetor[i]==6){ piscaMarrom(); } if(vetor[i]==7){ piscaAzulClaro(); } if(vetor[i]==8){ piscaVerdeClaro(); } if(vetor[i]==9){ piscaMagentaClaro(); } } for(j=0; j<nivel; j++){ textbackground(BLACK); printxy(36, 23, "COR : "); scanf("%i", &cor); printxy(42, 23, " "); if(vetor[j]==cor){ pontuacao = pontuacao + 10; gotoxy(16, 22);//antes era (4, 4) printf("PONTUACAO : %i", pontuacao); gotoxy(16, 23);//antes era (4, 5) printf("NIVEL : %i", (nivel)); } if(vetor[j]!= cor){ j = nivel; sair = 1; } } nivel++; }while(sair != 1); system("cls"); printxy(33, 9, "VOCE PERDEU!!!"); gotoxy(33, 11); printf("PONTUACAO : %i", pontuacao); gotoxy(33, 12); printf("NIVEL : %d", nivel); gotoxy(33,14); printf("Tecla Enter"); getch(); system("cls"); printxy(32, 8, "JOGAR NOVAMENTE?"); printxy(32, 9, " 1 - SIM"); printxy(32, 10, " 2 - NAO"); printxy(32, 12, " OPCAO : "); scanf("%i", &retorno); system("cls"); nivel = 1; pontuacao = 0; } }