Advertisement
Guest User

Untitled

a guest
Nov 16th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.76 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. using namespace System;
  4. enum Color { NEGRO, ROJO, AZUL, BLANCO, VERDE, AMARILLO, MORADO };
  5. void CambiarColorLetra(Color c) {
  6. switch (c) {
  7. case NEGRO: Console::ForegroundColor = ConsoleColor::Black; break;
  8. case ROJO: Console::ForegroundColor = ConsoleColor::Red; break;
  9. case AZUL: Console::ForegroundColor = ConsoleColor::Blue; break;
  10. case BLANCO: Console::ForegroundColor = ConsoleColor::White; break;
  11. case VERDE: Console::ForegroundColor = ConsoleColor::Green; break;
  12. case AMARILLO: Console::ForegroundColor = ConsoleColor::Yellow; break;
  13. case MORADO: Console::ForegroundColor = ConsoleColor::Magenta; break;
  14. }
  15. }
  16. void CambiarColorFondo(Color c) {
  17. switch (c)
  18. {
  19. case NEGRO: Console::BackgroundColor = ConsoleColor::Black; break;
  20. case ROJO: Console::BackgroundColor = ConsoleColor::Red; break;
  21. case AZUL: Console::BackgroundColor = ConsoleColor::Blue; break;
  22. case BLANCO: Console::BackgroundColor = ConsoleColor::White; break;
  23. case VERDE: Console::BackgroundColor = ConsoleColor::Green; break;
  24. case AMARILLO: Console::BackgroundColor = ConsoleColor::Yellow; break;
  25. case MORADO: Console::BackgroundColor = ConsoleColor::Magenta; break;
  26. }
  27. }
  28. void galaga() {
  29. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  30. cout << "X * X" << endl;
  31. cout << "X * * * X" << endl;
  32. cout << "X * * X" << endl;
  33. cout << "X * * X" << endl;
  34. cout << "X * * X" << endl;
  35. cout << "X * X" << endl;
  36. cout << "X * * * * X" << endl;
  37. cout << "X * X" << endl;
  38. cout << "X * * X" << endl;
  39. cout << "X * * * * X" << endl;
  40. cout << "X * * * * X" << endl;
  41. cout << "X X" << endl;
  42. cout << "X * * * * X" << endl;
  43. cout << "X * X" << endl;
  44. cout << "X * X" << endl;
  45. CambiarColorLetra(ROJO);
  46. cout << "X XXXXXXXXX X XX X XXXXXXXXX X X" << endl;
  47. cout << "X XX XXX XX XXX XX XXX X" << endl;
  48. cout << "X XX XX XX XX XX XX XX XX XX X" << endl;
  49. CambiarColorLetra(AZUL);
  50. cout << "X XX XX XX XX XX XX XX XX XX * X" << endl;
  51. cout << "X XX XX XX XX XX XX XX XX XX X" << endl;
  52. cout << "X * XX XXX XXXXXXXXX XX XXXXXXXXX XX XXX XXXXXXXXX X" << endl;
  53. cout << "X XX XX XX XX XX XX XX XX XX XX XX X" << endl;
  54. CambiarColorLetra(AMARILLO);
  55. cout << "X XX XX XX XX XX XX XX XX XX XX XX X" << endl;
  56. cout << "X XXXXXXXXX XX XX XXXXXXXX XX XX XXXXXXXXX XX XX X" << endl;
  57. cout << "X * * X" << endl;
  58. cout << "X X" << endl;
  59. cout << "X PRESS ANY KEY TO START... * * X" << endl;
  60. CambiarColorLetra(BLANCO);
  61. cout << "X * X" << endl;
  62. cout << "X * * X" << endl;
  63. cout << "X * * X" << endl;
  64. cout << "X * * * X" << endl;
  65. cout << "X * * X" << endl;
  66. cout << "X * * * X" << endl;
  67. cout << "X * * * X" << endl;
  68. cout << "X * * * * X" << endl;
  69. cout << "X * X" << endl;
  70. cout << "X * * X" << endl;
  71. cout << "X * * * * X" << endl;
  72. cout << "X * X" << endl;
  73. cout << "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" << endl;
  74. }
  75.  
  76. int main() {
  77. galaga();
  78. system("pause>0");
  79. return 0;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement