I make no guarantees as to whether this will work for you, I made two big assumptions about your system and compiler.
Code:
#include <cstdlib>
#include <iostream>
#include <string>
#include <conio.h>
#include <windows.h>
using namespace std;
void gotoxy ( short x, short y )
{
COORD coord = {x, y};
SetConsoleCursorPosition ( GetStdHandle ( STD_OUTPUT_HANDLE ), coord );
}
void draw_ship ( short x, short y )
{
gotoxy ( x, y );
cout<<"| |";
gotoxy ( x, ++y );
cout<<"|=[@]=|";
gotoxy ( x, ++y );
cout<<" ^ ";
}
void redraw ( short x, short y )
{
system ( "cls" );
draw_ship ( x, y );
}
int main()
{
short x = 10, y = 10;
while ( y > 0 && y < 17 && x > 0 && x < 20 ) {
redraw ( x, y );
switch ( getch() ) {
case 'w': --y; break;
case 's': ++y; break;
case 'a': --x; break;
case 'd': ++x; break;
}
}
}