it's supposed to keep printing in one of two spots, that's why there are 'gotoxy's. It doesn't though. It's a bit odd, please help me. thanks in advance;Code:#include <iostream.h> #include <windows.h> #include <conio.h> #include <fstream.h> #include <stdlib.h> #include <string> #include <stdio.h> int keypress=0; char message[50]; char tempmessage[50]; int count; int space1gone=0; int space2gone=0; void frame (int xmin,int ymin,int xmax,int ymax); void gotoxy(int,int); void printmove(char message[], char tempmessage[], int& space1gone, int& space2gone); void determinemessage(char message[], char tempmessage[], int& keypress); /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// int main() { frame(0,0,55,20); //Biggest box frame(56,0,79,24); //Right-side box frame(0,21,55,24); //Message Box while(keypress!=27) { keypress=0; if(kbhit()) { keypress=_getch(); cout<<flush; determinemessage(message, tempmessage, keypress); //Determine what to print printmove(message, tempmessage, space1gone, space2gone); //print in correct spot } } return 0; } //////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////// void frame (int xmin, int ymin, int xmax, int ymax) { int count; gotoxy(xmin,ymin); putchar(218); gotoxy(xmax,ymin); putchar(191); gotoxy(xmin,ymax); putchar(192); gotoxy(xmax,ymax); putchar(217); gotoxy(xmin+1,ymin); for(count=xmin; count<xmax-1; count++) putchar(196); gotoxy(xmin+1,ymax); for(count=xmin; count<xmax-1; count++) putchar(196); for(count=ymin+1; count<=ymax-1; count++) { gotoxy(xmin,count); putchar(179); } for(count=ymin+1; count<=ymax-1; count++) { gotoxy(xmax,count); putchar(179); } } void gotoxy(int x, int y) { HANDLE hConsoleOutput; COORD dwCursorPosition; dwCursorPosition.X = x; dwCursorPosition.Y = y; hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(hConsoleOutput,dwCursorPosition); } void printmove(char message[], char tempmessage[], int& space1gone, int& space2gone) { switch(space2gone) //checks if first spot is open { case 0: if(space1gone==0) //checks if second spot is open { gotoxy(1,22); cout<<message; gotoxy(1,22); } else if(space1gone==1) //first spot is used, second is open { gotoxy(1,23); cout<<message; gotoxy(1,23); } space1gone=1; break; case 1: gotoxy(1,22); cout<<" "; gotoxy(1,22); cout<<tempmessage; gotoxy(1,23); cout<<" "; gotoxy(1,23); cout<<message; gotoxy(1,23); break; } space2gone=1; } void determinemessage(char message[], char tempmessage[], int& keypress) { strcpy(tempmessage, message); strcpy(message, "Invalid move"); if(keypress==72) strcpy(message, "You moved up"); if(keypress==75) strcpy(message, "You moved left"); if(keypress==80) strcpy(message, "You moved down"); if(keypress==77) strcpy(message, "You moved right"); }