Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <conio.h>
- #include <iostream>
- using namespace std;
- using namespace System;
- int main()
- {
- int ex=3, ey=10, dex=1;
- int sx = 10, sy = 5, dsx=1;
- Console::SetCursorPosition(ex, ey);
- cout << "xxxx";
- Console::SetCursorPosition(sx, sy);
- cout << char(1);
- while (1)
- {
- _sleep(100);
- Console::SetCursorPosition(sx, sy);
- cout << " ";
- if (sx == 33)
- sx=0;
- sx += dsx;
- Console::SetCursorPosition(sx, sy);
- cout << char (1);
- Console::SetCursorPosition(ex, ey);
- cout << " ";
- if (ex == 53)
- dex = -1;
- if (ex == 3)
- dex = 1;
- ex += dex;
- Console::SetCursorPosition(ex, ey);
- cout << "xxxx";
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement