hmm... here is a bit of code i like to simplify this...
with visual c++ this seems to work just fine.
Take a look at the text_loc(x, y) in specific. it should function like goto(x,y)
Code:
#ifndef _CONSOLE_LIBRARY_INTERFACE
#define _CONSOLE_LIBRARY_INTERFACE
#include <windows.h>
WORD cl_fc_param = 0;
WORD cl_bc_param = 0;
void text_color(bool red, bool green, bool blue, bool bright)
{
cl_fc_param = 0;
if ( red ) cl_fc_param |= FOREGROUND_RED;
if ( green ) cl_fc_param |= FOREGROUND_GREEN;
if ( blue ) cl_fc_param |= FOREGROUND_BLUE;
if ( bright ) cl_fc_param |= FOREGROUND_INTENSITY;
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), cl_fc_param|cl_bc_param );
}
void text_background(bool red, bool green, bool blue, bool bright)
{
cl_bc_param = 0;
if ( red ) cl_bc_param |= BACKGROUND_RED;
if ( green ) cl_bc_param |= BACKGROUND_GREEN;
if ( blue ) cl_bc_param |= BACKGROUND_BLUE;
if ( bright ) cl_bc_param |= BACKGROUND_INTENSITY;
SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), cl_fc_param|cl_bc_param );
}
void text_loc(int x, int y)
{
COORD cursor_coordinates;
cursor_coordinates.X = x;
cursor_coordinates.Y = y;
SetConsoleCursorPosition( GetStdHandle(STD_OUTPUT_HANDLE), cursor_coordinates );
}
void console_title(const char* title)
{
SetConsoleTitle(title);
}
#endif