include windows static HANDLE Console COORD Cursor int GotoXY int int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <windows.h>
static HANDLE Console = 0;
COORD Cursor;
int GotoXY ( int x, int y )
{
if ( ! Console) Console = GetStdHandle(STD_OUTPUT_HANDLE);
Cursor.X = x;
Cursor.Y = y;
return SetConsoleCursorPosition(Console, Cursor);
}
int AddXY ( int x, int y )
{
if ( ! Console) Console = GetStdHandle(STD_OUTPUT_HANDLE);
Cursor.X += x;
Cursor.Y += y;
return SetConsoleCursorPosition(Console, Cursor);
}