Graphic design code

Can anyone post a simply graphic design code in c or c++?
(the output of the code should look like a design(example:name or ball shape)

Replies

  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    You can simulate it using different looping structures... 😀 Try using for loop and including graphics.h functions. Like drawing a line from one co-ordinate to another, again clearing it off, using the delay() method, etc.
  • rajesh_s
    rajesh_s
    can u please post 1 small graphi program
  • PraveenKumar Purushothaman
    PraveenKumar Purushothaman
    Check this out... Its a game!
    #include 
    using namespace std;
    int main()
    {
        int forever;
        int HIGH = 15;
        int LOW = 1;
        int HIGH1 = 50;
        int LOW1 = 0;
        int damage;
        int attack;
        int HEALTH;
        int enemyhealth;
        int travle;
        int TRYAGAIN;
        cout<<"IMPUT YOUR HEALTH\n";
        cin>>HEALTH;
        cout<<"IMPUT ENEMY HEALTH\n";
        cin>>enemyhealth;
        cout<<"1";
        cin>>forever;
        while(forever == 1) {
                      TRYAGAIN = 0;
                      damage = rand() % (HIGH - LOW);
                      attack = rand() % (HIGH1 - LOW1);
                      travle = attack-damage;
                      if (travle > 0) {
                                 enemyhealth = enemyhealth-travle;
                                 }
                      if (travle < 0){
                                 HEALTH = HEALTH+travle;
                                 }
                      if (HEALTH <0) {
                                 cout<<"YOU HAVE DIED AND GONE NITHER UP NOR DOWN!";
                                 system("Pause");
                                 forever = -1;
                                 cout<<"TRY AGAIN! 1=YES 0=NO";
                                 cin>>TRYAGAIN;
                                 HEALTH = +10;
                                 }
                      if (enemyhealth <0){
                                      cout<<"YOU HAVE CRUSHED YOUR ENEMY";
                                      system("Pause");
                                      forever = -1;
                                      cout<<"TRY AGAIN! 1=YES 0=NO";
                                      cin>>TRYAGAIN;
                                      enemyhealth = +10;
                                      }
                      cout<<"DAMMAGE="<>HEALTH;
                                      cout<<"IMPUT ENEMY HEALTH\n";
                                      cin>>enemyhealth;
                                      }
                      }
     
     
        cin.get();
    }

You are reading an archived discussion.

Related Posts

It happens with me many time that I had to copy some files from my pen drive to our college lab and the moment I plugged in my pen drive,...
Check this out guys! BOTIX is a 2 day hands-on workshop that focuses on introducing participants to the world of robotics. Split over 4 sessions participants are introduced to various...
Hey guys I want to develop a real time system but I don't have much idea about this. Can you guide what topic I can go for and in which...
Symptoms are same during 2nd world war , Hitler was the reason and now again a another stubborn leader named gadafi Today the world has been divided because of libya...
I had this idea many months ago, and posting it here for your feedback. One thing most of the engineering students love to do is discuss the question paper with...