Advertisement
Guest User

Interesting

a guest
Sep 20th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.64 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include "conio.h"
  3. #include "iostream"
  4.  
  5. using namespace System;
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int Mapa[30][60] = {
  11.         { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 },
  12.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  13.         { 1,2,0,0,0,0,0,0,0,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  14.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1 },
  15.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,0,0,0,0,0,0,5,5,5,0,2,0,0,0,0,1 },
  16.         { 1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  17.         { 1,0,0,0,0,1,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,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1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1 },
  34.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,5,0,0,0,0,1,0,0,0,1 },
  35.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1 },
  36.         { 1,0,0,0,0,0,0,0,3,3,3,0,0,0,1,0,0,0,0,0,1,0,0,5,0,0,0,3,3,3,0,0,0,1,0,0,0,0,0,1,0,0,0,5,5,5,0,0,0,1,1,1,1,1,0,1,0,0,0,1 },
  37.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,5,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,5,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  38.         { 1,0,2,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  39.         { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 },
  40.         { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }
  41.  
  42.  
  43.    
  44.     };
  45.  
  46.     //tamaño del consola
  47.     Console::SetWindowSize(80, 40);//define el tam de la ventana de consola
  48.     //imprimir matriz
  49.     for (int f=0; f<30; f++)
  50.     {
  51.         for (int c = 0; c < 60; c++)
  52.         {
  53.             if (Mapa[f][c] == 0) { Console::ForegroundColor = ConsoleColor::Black; cout << (char)219; }
  54.             if (Mapa[f][c] == 1) { Console::ForegroundColor = ConsoleColor::Cyan; cout << (char)219; }
  55.        
  56.             if (Mapa[f][c] == 2) { Console::ForegroundColor = ConsoleColor::Yellow; cout << (char)4; }
  57.             if (Mapa[f][c] == 3) { Console::ForegroundColor = ConsoleColor::Green; cout << (char)5; }
  58.             if (Mapa[f][c] == 5) { Console::ForegroundColor = ConsoleColor::Red; cout << (char)178; }
  59.  
  60.             //cout << (char)219;
  61.         }
  62.         cout << "\n";
  63.     }
  64.  
  65.     _getch();
  66.     return 0;
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement