Á¤¼ºÈÆ
    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] Á¶È¸ : 491 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûstringio.c (±³Àç)
¡ä ´ÙÀ½±Ûpassword.c (±³Àç)
ÇÁ·Î±×·¡¹Ö¾ð¾î ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
l½Ç½À ¸ñÂ÷
210 ¦¦❶ lstrcmp.c (±³Àç) 559 02-23
209 ¦¦❶ lstrcat.c (±³Àç) 506 02-23
208 ¦¦❶ lstrcpy.c (±³Àç) 450 02-23
207 ¦¦❶ lstrlen.c (±³Àç) 462 02-23
206 ¦¦❶ lstringio2.c (±³Àç) 445 02-23
205 ¦¦❶ lstringio.c (±³Àç) 484 02-23
204 ¦¦❶ ltext_game.c (±³Àç) 491 02-23
203 ¦¦❶ lpassword.c (±³Àç) 502 02-23
202 ¦¦❶ l_getchar.c (±³Àç) 457 02-23
201 ¦¦❶ lgetchar.c (±³Àç) 442 02-23
200 ¦¦❶ lpre_string.c (±³Àç) 427 02-23
199 ¦¦❶ lstring3.c (±³Àç) 429 02-23
198 ¦¦❶ lstring2.c (±³Àç) 448 02-22
197 ¦¦❶ lstring1.c (±³Àç) 475 02-22
196 (9Àå) Æ÷ÀÎÅÍ 529 02-22
195 ¦¦❶ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ ¿¹Á¦µé 129 05-26
194    ¦¦❷ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (1) 166 05-26
193       ¦¦❸ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (2) 175 05-26
192          ¦¦❹ ¹è¿­À» ÀÌ¿ëÇÑ È£Ãâ (3) 197 05-26
191 ¦¦❶ Mini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) 1403 04-24

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