#include<stdio.h>

#include<stdlib.h>

#include<Windows.h>

#include<time.h>

#include<conio.h>


void gotoxy(int x,int y);

void move();

void map();

void change(int a);

void change2();

void change3(int b);


int x=3,y=2;

int chr;

int substitute;


char map1[] = {"┏━┳━┳━┳━┳━┳━┳━┳━┓"};

char map2[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map3[] = {"┣━╋━╋━╋━╋━╋━╋━╋━┫"};

char map5[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map6[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map7[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map8[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map9[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map10[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map11[] = {"┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃  ┃"};

char map4[] = {"┗━┻━┻━┻━┻━┻━┻━┻━┛"};


char* str;


int main(void)

{

    map();

    while(1)

    {

            gotoxy(x,y);

            printf("[]");



        if(_kbhit())

        {

            move(); 

            map(); 

        }

   


    }


system("pause");

return 0;


}


void map()

{

printf("%s\n", map1);

printf("%s\n", map2);

printf("%s\n", map3);

printf("%s\n", map5);

printf("%s\n", map3);

printf("%s\n", map6);

printf("%s\n", map3);

printf("%s\n", map7);

printf("%s\n", map3);

printf("%s\n", map8);

printf("%s\n", map3);

printf("%s\n", map9);

printf("%s\n", map3);

printf("%s\n", map10);

printf("%s\n", map3);

printf("%s\n", map11);

printf("%s\n", map4);

}

void move()

{

    chr = getch();

    if(chr == 0 || chr == 224)

    {

        chr = getch();

        if(chr == 72)

        {

            y-=2;

            system("cls");

            if(y<1)y=2;

        }

        if(chr == 80)

        {

            y+=2;

            system("cls");

            if(y>16)y=16;      

        }

        if(chr == 75)

        {

            x-=4;

            system("cls");

            if(x<1)x=3;       

        }

        if(chr == 77)

        {

            x+=4;     

            system("cls");

            if(x>33)x=31;

        }

    }

    else

    {

        change(y);

    }


        

    system("cls");

    

}




void gotoxy(int x,int y)

{

 COORD Pos = {x-1,y-1};

 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Pos);


void change(int a)

{

switch(a)

{

case 2:

str = map2;

change2();

break;


case 4:

str = map5;

change2();

break;


case 6:

str = map6;

change2();

break;


case 8:

str = map7;

change2();

break;


case 10:

str = map8;

change2();

break;


case 12:

str = map9;

change2();

break;


case 14:

str = map10;

change2();

break;


case 16:

str = map11;

change2();

break;

}

}

void change2()

{

if(x == 3)

change3(x);


if(x == 7)

change3(x);


if(x == 11)

change3(x);


if(x == 15)

change3(x);


if(x == 19)

change3(x);


if(x == 23)

change3(x);


if(x == 27)

change3(x);


if(x == 31)

change3(x);

}

void change3(int b)

{

if(chr == 49)

{

str[b] = '!';

str[--b] = '!';

}

if(chr == 50)

{

str[b] = '?';

str[--b] = '?';

}

if(chr == 51)

{

str[b] = ' ';

str[--b] = ' ';

}

}







방향키로 [] 이놈을 8*8칸 안에서 움직이면서 

칸위에서 숫자1을 눌렀을경우 그칸이 '!!' 2를 눌렀을경우 '??' 3을 눌렀을경우 공백 으로 채워짐