Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- using namespace System;
- enum Color { NEGRO, ROJO, AZUL, BLANCO, VERDE, AMARILLO, MORADO };
- void CambiarColorLetra(Color c) {
- switch (c) {
- case NEGRO: Console::ForegroundColor = ConsoleColor::Black; break;
- case ROJO: Console::ForegroundColor = ConsoleColor::Red; break;
- case AZUL: Console::ForegroundColor = ConsoleColor::Blue; break;
- case BLANCO: Console::ForegroundColor = ConsoleColor::White; break;
- case VERDE: Console::ForegroundColor = ConsoleColor::Green; break;
- case AMARILLO: Console::ForegroundColor = ConsoleColor::Yellow; break;
- case MORADO: Console::ForegroundColor = ConsoleColor::Magenta; break;
- }
- }
- void CambiarColorFondo(Color c) {
- switch (c)
- {
- case NEGRO: Console::BackgroundColor = ConsoleColor::Black; break;
- case ROJO: Console::BackgroundColor = ConsoleColor::Red; break;
- case AZUL: Console::BackgroundColor = ConsoleColor::Blue; break;
- case BLANCO: Console::BackgroundColor = ConsoleColor::White; break;
- case VERDE: Console::BackgroundColor = ConsoleColor::Green; break;
- case AMARILLO: Console::BackgroundColor = ConsoleColor::Yellow; break;
- case MORADO: Console::BackgroundColor = ConsoleColor::Magenta; break;
- }
- }
- void galaga() {
- cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
- cout << "X * X" << endl;
- cout << "X * * * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X * X" << endl;
- cout << "X * X" << endl;
- CambiarColorLetra(ROJO);
- cout << "X XXXXXXXXX X XX X XXXXXXXXX X X" << endl;
- cout << "X XX XXX XX XXX XX XXX X" << endl;
- cout << "X XX XX XX XX XX XX XX XX XX X" << endl;
- CambiarColorLetra(AZUL);
- cout << "X XX XX XX XX XX XX XX XX XX * X" << endl;
- cout << "X XX XX XX XX XX XX XX XX XX X" << endl;
- cout << "X * XX XXX XXXXXXXXX XX XXXXXXXXX XX XXX XXXXXXXXX X" << endl;
- cout << "X XX XX XX XX XX XX XX XX XX XX XX X" << endl;
- CambiarColorLetra(AMARILLO);
- cout << "X XX XX XX XX XX XX XX XX XX XX XX X" << endl;
- cout << "X XXXXXXXXX XX XX XXXXXXXX XX XX XXXXXXXXX XX XX X" << endl;
- cout << "X * * X" << endl;
- cout << "X X" << endl;
- cout << "X PRESS ANY KEY TO START... * * X" << endl;
- CambiarColorLetra(BLANCO);
- cout << "X * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * * X" << endl;
- cout << "X * * * X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X * X" << endl;
- cout << "X * * X" << endl;
- cout << "X * * * * X" << endl;
- cout << "X * X" << endl;
- cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
- }
- int main() {
- galaga();
- system("pause>0");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement