Saturday, May 6, 2017

Simple Animation in C++


A very simple program that I wrote in C++ to demonstrate simple animation. I am using CodeBlocks as my text editor and Dev C++ as my C++ compiler in this program. Thank you.


My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.


Program Listing


#include<iostream>
#include<stdio.h>
#include<dos.h>
#include <windows.h>
#include<conio.h>


using namespace std;

int main()
{
       int y=0;
       char d='|';
        for(int x=0; x<=50; x++)
        {

                y= rand() % 300;
                Sleep(y);
                system("cls");
                if(d=='|')
                  d='/';
                else if(d=='/')
                     d='-';
                else if(d=='-')
                     d='\\';
                else if(d=='\\')
                     d='|';
                 cout<<"Loading Program--------> "<<d;

        }

        cin.get();
        return 0;
}


No comments:

Post a Comment