Á¤¼ºÈÆ
    text_game.c (±³Àç)
  http://itsys.hansung.ac.kr/cgi-bin/onlineTest/viewCcoding/onlineCcoding.cgi?source=src/chap10/text_game.c



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
 
int main(void) {
    char board[10][10= { {'#''#''#''#''.''.''.''.''.''.' },
        {'.''.''.''.''.''#''.''.''.''.' },
        {'#''#''#''.''#''.''.''.''.''.' },
        {'.''.''#''.''.''#''.''.''.''.' },
        {'.''.''#''.''.''#''.''.''.''.' },
        {'.''.''#''.''.''#''.''.''.''.' },
        {'.''.''.''#''.''.''#''#''.''.' },
        {'.''.''.''.''#''.''.''.''#''#' },
        {'.''.''.''.''.''#''.''.''.''.' },
        {'.''.''.''.''.''#''#''#''#''#' } };
    int xpos = 0, ypos = 1;
    board[ypos][xpos] = '@';
 
    // »ç¿ëÀڷκÎÅÍ À§Ä¡¸¦ ¹Þ¾Æ¼­ º¸µå¿¡ Ç¥½ÃÇÑ´Ù.
    while (1) {
        system("cls");
        printf("¿ÞÂÊÀ̵¿:<-, ¿À¸¥ÂÊ À̵¿:-> À§ÂÊ À̵¿:^, ¾Æ·¡ÂÊ À̵¿:V\n");
        for (int y = 0; y < 10; y++) {
            for (int x = 0; x < 10; x++printf("%c", board[y][x]);
            printf("\n");
        }
        board[ypos][xpos] = '.';
        int ch = _getch();
        if (ch == 224) {
            int ch2 = _getch();
            if (ch2 == 75) xpos--;
            else if (ch2 == 80) ypos++;
            else if (ch2 == 72) ypos--;
            else if (ch2 == 77) xpos++;
        }
        board[ypos][xpos] = '@';
    }
    return 0;
}
cs

  µî·ÏÀÏ : 2022-02-23 [00:09] Á¶È¸ : 427 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûstringio.c (±³Àç)
¡ä ´ÙÀ½±Ûpassword.c (±³Àç)
ÇÁ·Î±×·¡¹Ö¾ð¾î ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
l½Ç½À ¸ñÂ÷
198 ¦¦❶ lstrcmp.c (±³Àç) 492 02-23
197 ¦¦❶ lstrcat.c (±³Àç) 435 02-23
196 ¦¦❶ lstrcpy.c (±³Àç) 388 02-23
195 ¦¦❶ lstrlen.c (±³Àç) 396 02-23
194 ¦¦❶ lstringio2.c (±³Àç) 381 02-23
193 ¦¦❶ lstringio.c (±³Àç) 422 02-23
192 ¦¦❶ ltext_game.c (±³Àç) 427 02-23
191 ¦¦❶ lpassword.c (±³Àç) 425 02-23
190 ¦¦❶ l_getchar.c (±³Àç) 398 02-23
189 ¦¦❶ lgetchar.c (±³Àç) 380 02-23
188 ¦¦❶ lpre_string.c (±³Àç) 370 02-23
187 ¦¦❶ lstring3.c (±³Àç) 368 02-23
186 ¦¦❶ lstring2.c (±³Àç) 395 02-22
185 ¦¦❶ lstring1.c (±³Àç) 410 02-22
184 (9Àå) Æ÷ÀÎÅÍ 476 02-22
183 ¦¦❶ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ ¿¹Á¦µé 100 05-26
182    ¦¦❷ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (1) 122 05-26
181       ¦¦❸ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (2) 135 05-26
180          ¦¦❹ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (3) 153 05-26
179 ¦¦❶ Mini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) 1286 04-24

[1][2][3][4][5][6][7][8][9][10]-[Next][13]