Á¤¼ºÈÆ
    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] Á¶È¸ : 1143 ´Ù¿î : 0   
 
¡â ÀÌÀü±Ûstringio.c (±³Àç)
¡ä ´ÙÀ½±Ûpassword.c (±³Àç)
CÇÁ·Î±×·¡¹Ö(ÇÁ·Î±×·¡¹Ö¾ð¾î) ½Ç½À°Ô½ÃÆÇ
¹øÈ£ ¨Ï Á¦ ¸ñ Á¶È¸ µî·ÏÀÏ
lMini Project (¾îµåº¥Ã³ °ÔÀÓ ¸¸µé±â) Ãß°¡ ±¸Çö // ¡Ú¡Ú¡Ú ±â¸»°úÁ¦ °ÔÀÓ±¸Çö ½Ã Âü°í
l½Ç½À ¸ñÂ÷
229 ¦¦❶ lhangman.c (±³Àç) 1164 02-23
228 ¦¦❶ lchar_ptr.c (±³Àç) 1065 02-23
227 ¦¦❶ lcalc_quiz.c (±³Àç) 1111 02-23
226 ¦¦❶ latoi.c (±³Àç) 1207 02-23
225 ¦¦❶ lstrcmp.c (±³Àç) 1264 02-23
224 ¦¦❶ lstrcat.c (±³Àç) 1212 02-23
223 ¦¦❶ lstrcpy.c (±³Àç) 1037 02-23
222 ¦¦❶ lstrlen.c (±³Àç) 1076 02-23
221 ¦¦❶ lstringio2.c (±³Àç) 1009 02-23
220 ¦¦❶ lstringio.c (±³Àç) 1092 02-23
219 ¦¦❶ ltext_game.c (±³Àç) 1143 02-23
218 ¦¦❶ lpassword.c (±³Àç) 1160 02-23
217 ¦¦❶ l_getchar.c (±³Àç) 1049 02-23
216 ¦¦❶ lgetchar.c (±³Àç) 1103 02-23
215 ¦¦❶ lpre_string.c (±³Àç) 1050 02-23
214 ¦¦❶ lstring3.c (±³Àç) 1057 02-23
213 ¦¦❶ lstring2.c (±³Àç) 1051 02-22
212 ¦¦❶ lstring1.c (±³Àç) 1152 02-22
211 (9Àå) Æ÷ÀÎÅÍ 1267 02-22
210 ¦¦❶ (9Àå) Æ÷ÀÎÅÍ ¼ö¾÷ ¼³¸í ¿¹Á¦ ÇÁ·Î±×·¥ 554 05-17

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