Translate

Alphabets Animation

video
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<windows.h>
#include<stdlib.h>
void gotoxy(short x, short y)
{
    HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
    COORD position = { x, y };
    SetConsoleCursorPosition(handle, position);
}

using namespace std;
class card
{
public:
    card() {};
    card(int, int);
    void move(int a, int b, int c) {
        gotoxy(a, b);
        printf("%c", c);
    }
private:
    int x;
    int y;
}a, b, c, d;

card::card(int a, int b) :x(a), y(b)
{
    gotoxy(x, y);
}

void main(void)
{
    getch();

    int comp = 0;
    for (int l = 0; comp <= 22;) {
        for (int loop = 0; loop <= 10; loop++)
        {
            a.move(25 + loop, 25, 65 + comp);
            b.move(35, 25 - loop, 66 + comp);
            c.move(35 - loop, 15, 67 + comp);
            d.move(25, loop + 15, 68 + comp);
            Sleep(100);
            a.move(25 + loop, 25, 32);
            b.move(35, 25 - loop, 32);
            c.move(35 - loop, 15, 32);
            d.move(25, loop + 15, 32);
        }
        comp++;
    }

    getche();
}
Previous
Next Post »

Contact Form

Name

Email *

Message *