ASCII Art

Да се изведе голямо усмихнато лице (или нещо друго, потърсете в Google „ASCII Art“ за идеи). При натискане на клавиш картинката да изчезне или да се смени с друга.

Публикувано в 11а с етикети , . Постоянна връзка.

5 Responses to ASCII Art

  1. dreanor каза:
    #include <cstdlib>
    #include <iostream>
    #include <windows.h>
    
      void gotoxy( int x, int y )
        {
        COORD p = { x, y };
        SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), p );
        }
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        
        gotoxy ( 15,9);
        cout <<"     ____    _____  _______________________     _____  _______"<<endl;
        gotoxy ( 15,10);
        cout <<"    / _  |  / ___/ / ____/  _/  _/    / _  |   / __  \/_  __/"<<endl;
        gotoxy ( 15,11);
        cout <<"   / /_| |  \___ \/ /    / / / /     / /_| |  / /__/ / / /"<<endl;
        gotoxy ( 15,12);
        cout <<"  / /  | |     / / /    / / / /     / /  | | / /  / / / /"<<endl;
        gotoxy ( 15,13);
        cout <<" / /___| | ___/ / /___ / / / /     / /___| |/ /  / / / /"<<endl;
        gotoxy ( 15,14);
        cout <<"/_/    |_|_____/\____/___/___/    /_/    |_/_/   |_|/_/ "<<endl;
        gotoxy ( 15,15);
        cout <<endl<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    
    • Данаил каза:

      Супер! Можеше да сложиш gotoxy и cout на един ред, за да си личи още от кода на програмата какво отпечатваш. По принцип не е добре да се слагат няколко команди на един ред, защото не е удобно за редактиране, не е прегледно и затруднява дебъгването, но в този конкретно случай ще направи програмата по-прегледна.

  2. emi4ka1995 каза:
     #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
      cout<<"    $$$$$$$$" <<endl;
      cout<<"   $$$$$$$$$$" <<endl;
      cout<<"  $$$$$$$$$$$$" <<endl;
      cout<<"  $$ O    O $$" <<endl;
      cout<<"  $$   ()    $$" <<endl;
      cout<<" $$$ \\    / $$$" <<endl;
      cout<<" $$$  \\__/  $$$ " <<endl;
      cout<<"    \\______/" <<endl;
      cout<< " \n\n\n" ;
          system("PAUSE");
      cout<< "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
      cout<<" #####" <<endl;
      cout<<" #### _ \\ "<<endl;
      cout<<" ##=-[.].]     | \\    \\| " <<endl;
      cout<<" #(    _\\    |  ------||" <<endl;
      cout<<" #   __|       |  |||||||| " <<endl;
      cout<<" \  _/         |  ||||||||    ITS YOU!!! " <<endl;
      cout<<"-'--'-.  |      | ____ | " <<endl;
      cout<<"/ __      ` |__|[o__o]| " <<endl;
      cout<<"_(____nm_______ /____\____ "<<endl;
    
        system("PAUSE");
        return EXIT_SUCCESS;
    } 

Вашият коментар