본문 바로가기

정리 카테고리/개인복습&정리

0309_시험 소스

1.결과 화면 및 샘플


number2.exe







2.소스 코드


PS.상태에서 0,0 마을만 아니면 "보다"로 몹을 보고 "쳐"명령어로 잡으면 알아서 완료 체크까지 한다

    이번에 돌려보면서 알게 된건데 몹을 안잡으면 쌓인다.......<ㅁ>.,<ㅁ>!!!

     배열을 넣게되면 지도에 위치도 예쁘게 표시가 되겠지!!!

     파란색은 않좋다....특히 눈에..... 




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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
       //글자 색상이 나오는 함수
        public static string ColoredConsoleWrite(ConsoleColor color, string text)
        {
            ConsoleColor originalColor = Console.ForegroundColor;
            Console.ForegroundColor = color;
            Console.Write(text);
            Console.ForegroundColor = originalColor;
            return text;
        }
 
        //이미 나와있는 1줄은 지워주는 함수
        public static void ClearCurrentConsoleLine()
        {
            int currentLineCursor = Console.CursorTop;
            Console.SetCursorPosition(0Console.CursorTop);
            Console.Write(new string(' 'Console.WindowWidth));
            Console.SetCursorPosition(0, currentLineCursor);
        }
 
 
        //메인------------------------
        static void Main(string[] args)
        {
 
 
 
            string userID = "";//유저 아이디
            string userPW = "";//유저 암호
            string userPWmatch = "";//유저 암호 확인
            string userSX = "";//유저 성별
            string userNick = "";//유저의 닉네임
            string user9TName = "";//유저 종족명  9개 타입 == 9T
            string userWhere = "튜토리얼";//튜토리얼,마을,사냥터
             
 
            string monsterName1 = "늑대";
            string monsterName2 = "곰";
            string questMonsterName = "";//퀘스트에 필요한 몬스터 이름
            string questDoName = ""//진행중인 퀘스트 이름
            string questName1 = "늑대 5마리 잡기";//퀘스트명
            string questName2 = "늑대 10마리 잡기";
            string questName3 = "곰 5마리 잡기";
            string questName4 = "곰 10마리 잡기";
 
 
            int user9TNumber = 0;// 유저 종족번호
            int userHP = 300;//유저 체력
            int userMP = 170;//유저 마력
            int userAP = 35;//유저 공격력
            int userDP = 15;//유저 방어력
            int userLV = 1;//유저 레벨
            int userEXE = 0;//유저 경험치
            int userXHere = 0;//유저 가로 좌표
            int userYHere = 0;//유저 세로 좌표
 
            int monsterPower1 = 25;//몬스터 1 공격력
            int monsterHP1 = 70;//몬스터 1 체력
            int monsterExe1 = 20;//몬스터 1 기여경험치
            int monsterPower2 = 65;//몬스터 2 공격력
            int monsterHP2 = 170;//몬스터 2 체력
            int monsterExe2 = 40;//몬스터 2 기여 경험치
            int mapMonster1 = 0;//해당맵 몬스터 1 존재여부
            int mapMonster2 = 0;//해당맵 몬스터 2 존재여부
 
 
            int quest1Save = 0//퀘스트 진행량
            int questTotal = 0;//퀘스트에 필요한 사냥수
            int questDo = 0;//진행중인 퀘스트 번호
            int questEnd1 = 0//1번 퀘스트 완료 횟수
            int questEnd2 = 0//2번 퀘스트 완료 횟수
            int questEnd3 = 0//3번 퀘스트 완료 횟수
            int questEnd4 = 0//4번 퀘스트 완료 횟수
 
 
            bool mainLoopCheck = true;//튜토리얼 이후 돌아가는 메인 루프 체크
 
 
            string checkCommand = "";
             
            ColoredConsoleWrite(ConsoleColor.Cyan, "꿈의나라");//게임 세계명
            Console.WriteLine("에 오신것을 진심으로 환영합니다.");//환영문구
            mainStart:
            Console.WriteLine("[ENTER]를 누르세요.");
            ConsoleKeyInfo inputKey = Console.ReadKey();
            ClearCurrentConsoleLine();
            //엔터 확인
            if (inputKey.Key != ConsoleKey.Enter) goto mainStart;
            //아이디입력
            setID:
            Console.WriteLine("당신의 아이디는 무엇인가요?");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            userID = Console.ReadLine();
            Console.WriteLine("당신의 아이디가  '" + userID + "'가 맞습니까? [Y/N]");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand != "Y"goto setID;
 
             
            Console.WriteLine("어머 처음 오셧네요~~ 환영해요~~ 당신은 꿈의 나라에서 누구라 불립니까?");
            resetNic://닉네임 설정
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            userNick = Console.ReadLine();
            Console.WriteLine("새로운 이름이군요. 이 이름으로 원하십니까? <y n="">");
            reCommandNic:
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
            if (checkCommand == "Y") ;
            else if (checkCommand == "N")
            {
                Console.WriteLine("그러면 새로운 이름을 입력하세요.");
                goto resetNic;
            }
            else
            {
                Console.WriteLine("<y n="">중 하나로 대답해주세요.");
                goto reCommandNic;
            }
 
            setPW://암호 설정
            Console.WriteLine("암호를 입력해주세요.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            userPW = Console.ReadLine();
 
            Console.WriteLine("확인을 위해 다시한번 암호를 입력해주세요.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            userPWmatch = Console.ReadLine();
 
            if (userPW == userPWmatch) ;
            else
            {
                Console.WriteLine("먼저 입력하신 암호와 다르군요.");
                Console.WriteLine("암호를 다시 정하죠.");
                goto setPW;
            }
 
 
 
 
            Console.WriteLine("당신의 성별은 무엇입니까? <남/여>");
            resetSX://성별 설정
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");           
            userSX = Console.ReadLine();
 
            if (userSX == "남" || userSX == "여") ;
            else
            {
                Console.WriteLine("성별이 어떻게 된다구요? <남/여>");
                goto resetSX;
            }
 
 
            ColoredConsoleWrite(ConsoleColor.Cyan, "꿈의나라");//게임 세계명
            Console.WriteLine("에는 다음과 같은 아홉 신족이 있습니다.");
            Console.WriteLine("=> 천신(1)/지신(2)/마신(3)/ \n  용신(4)/호신(5)/수신(6)\n  화신(7)/광신(8)/사신(9)");
            Console.WriteLine("당신은 어느 신족에 속하십니까?(해당 번호를 입력하세요)");
            reset9T://종족 설정  +  9개 타입 == 9T
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if(checkCommand == "1")
            {
                user9TName="천신" ;
                user9TNumber = 1;
            }
            else if (checkCommand == "2")
            {
                user9TName = "지신";
                user9TNumber = 2;
            }
            else if (checkCommand == "3")
            {
                user9TName = "마신";
                user9TNumber = 3;
            }
            else if (checkCommand == "4")
            {
                user9TName = "용신";
                user9TNumber = 4;
            }
            else if (checkCommand == "5")
            {
                user9TName = "호신";
                user9TNumber = 5;
            }
            else if (checkCommand == "6")
            {
                user9TName = "수신";
                user9TNumber = 6;
            }
            else if (checkCommand == "7")
            {
                user9TName = "화신";
                user9TNumber = 7;
            }
            else if (checkCommand == "8")
            {
                user9TName = "광신";
                user9TNumber = 8;
            }
            else if (checkCommand == "9")
            {
                user9TName = "사신";
                user9TNumber = 9;
            }
            else
            {
                Console.WriteLine("그런 신족은 없는데요? 다시한번 입력해주세요(1~9)");
                goto reset9T;
            }
 
            Console.WriteLine("하늘의 미소를 품고 있는 천신족장이 서있다.\n");
            sayHelp://명령어 도움말
            Console.WriteLine("천신족장이 빙긋 웃으면서 말했습니다.");
            Console.WriteLine("'안녕하신가? 하누리에 오게된것을 환영하네.'");
            Console.WriteLine("천신족장이 환한 웃음을 지으며 말했습니다.");
            Console.WriteLine("'난 천신족의 꼭두라네.'");
            Console.WriteLine("우선 이세계에서 생활하는데 필요한 기본적인 것들에 대해서 일러주겠네....");
            Console.WriteLine("부디 잘 배워두어 이곳에서 생활하는데 불편함이 없기를 바라네.");
            Console.Write("그럼일단 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<도움말>");
            Console.WriteLine("이라고 입력해 보게나.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Equals("도움말")) ;
            else goto sayHelp;
 
            Console.WriteLine("============================================================================");
            Console.WriteLine("도움말 사용 방법");
            Console.WriteLine("*도움말 : 이 화면을 보여 줍니다.");
            Console.WriteLine("============================================================================");
 
             
            sayMoveHelp://명령어 이동 + 도움말
            Console.WriteLine("천신족장이 약간 찡그리며 말합니다.");
            Console.WriteLine("음..자네 수업태도가 별로 좋지 않구만..");
            Console.Write("빨리 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<이동> <도움말>");
            Console.WriteLine ("이라고 입력해 보게나..");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Equals("이동 도움말")) ;
            else goto sayMoveHelp; ;
 
            Console.WriteLine("-이동에 관한 명령어");
            Console.WriteLine("============================================================================");
            Console.WriteLine("* 설명 : 한 장소에서 인접한 다른 장소로 이동할 때 사용되는 명령입니다.");
            Console.WriteLine("이동을 하기 위새서는 현재 장소에서 해당 방향으로 나가는 출구가 존재해야 합니다.");
            Console.WriteLine("* 동 - 동쪽으로 이동합니다.");
            Console.WriteLine("* 서 - 서쪽으로 이동합니다.");
            Console.WriteLine("* 남 - 남쪽으로 이동합니다.");
            Console.WriteLine("* 북 - 북쪽으로 이동합니다.");
            Console.WriteLine("* 위 - 위쪽으로 이동합니다.");
            Console.WriteLine("* 밑 - 밑쪽으로 이동합니다.");
            Console.WriteLine("* 출구 - 현재 장소에서 이동할수 있는 방향과 장소를 보여줍니다.");
            Console.WriteLine("============================================================================");
 
            resetTalk://명령어 말
            Console.WriteLine("천신족장이 약간 찡그리며 말합니다.");
            Console.WriteLine("음... 자네 내게 하고 싶은 말이 하나도 없나?");
            Console.Write("빨리 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<하고픈말> <말>");
            Console.WriteLine("이라고 입력해 보게나..");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Contains(" 말"))
            {
                Console.Write("당신이 말하였습니다.");
                ColoredConsoleWrite(ConsoleColor.Blue , checkCommand.Replace(" 말""")+"\n");
            }
            else goto resetTalk;
 
            resetWhere://명령어 이동
            Console.Write("천신족장이 말했습니다.빨리 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<동>");
            Console.WriteLine("쪽으로 안가고 머하나?");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Equals("동")) ;
            else
            {
                Console.WriteLine("막혀있는 방향입니다.");
                goto resetWhere;
            }
 
 
            resetThrow://명령어 버리다
            Console.WriteLine("묵직한 모습으로 가부좌를 틀고 앉아있는 지신족장이 있다.");
            Console.WriteLine("지신족장이 약간 찡그리며 말합니다.");
            Console.WriteLine("음..자네 그 물건이 아까워서 못버리나?");
            Console.Write("빨리 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<단검> <버리다>");
            Console.WriteLine("라고 입력해 보게나.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Equals("단검 버리다")) ;
            else goto resetThrow;
 
            Console.Write("당신이 ");
            ColoredConsoleWrite(ConsoleColor.Cyan, "단검" );
            Console.WriteLine("(을)를 버렸습니다.");
 
            resetSee://명령어 (둘러)보다
            Console.WriteLine("지신족장이 약간 찡그리며 말합니다.");
            Console.WriteLine("음...자네 수업태도가 별로 좋지 못하구만..");
            Console.Write("어서 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<보다>");
            Console.WriteLine("라고 입력해 보게나.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
            if (checkCommand.Equals("보다")) ;
            else goto resetSee;
 
            Console.WriteLine("묵직한 모습으로 가부좌를 틀고 앉아있는 지신족장이 있다.");
            ColoredConsoleWrite(ConsoleColor.Cyan, "까만 색의 단검이 떨어져 있다");
 
            resetNip://명령어 집다
            Console.WriteLine("지신족장이 약간 찡그리며 말합니다.");
            Console.WriteLine("음...자네 수업태도가 별로 좋지 못하구만..");
            Console.Write("어서 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<단검>  <집다>");
            Console.WriteLine("라고 입력해 보게나.");
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
 
 
            if (checkCommand.Equals("단검 집다")) ;
            else goto resetNip;
 
 
            Console.Clear();
            Console.Write("당신이 ");
            ColoredConsoleWrite(ConsoleColor.Cyan, "단검");
            Console.WriteLine("(을)를 집었습니다.");
 
            Console.WriteLine("지신족장이 웃으며 말합니다.");
            Console.WriteLine("참 잘했네...");
            Console.Write("이제 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<명령어>");
            Console.WriteLine("라고 입력해 행동할수 있네.");
            Console.Write("머 일단은 ");
            ColoredConsoleWrite(ConsoleColor.Yellow, "<마을>");
            Console.WriteLine("을 입력해서 마을로 가는게 어떤가?");
 
            resetGo:
            ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
            checkCommand = Console.ReadLine();
            if (checkCommand.Equals("마을")) userWhere = "마을";
            else goto resetGo;
 
            Console.WriteLine("마을에 도착했습니다.");
            while (mainLoopCheck)
            {
                
 
                inputCommandCheck://입력받은 명령어 체크시작 부분
                //명령어 또는 도움말로 명령어보기
                if(checkCommand == "명령어"||checkCommand=="도움말")
                {
                    Console.Clear();
                    Console.WriteLine("============================================================================");
                    Console.WriteLine("<지도> - 전체 지형을 보여준다.");
                    Console.WriteLine("<퀘스트 봐> - 전체 퀘스트를 보여준다.");
                    Console.WriteLine("<퀘스트 수락> - 퀘스트를 수령한다.");
                    Console.WriteLine("<퀘스트 완료> - 완료한 퀘스트를 확인한다.");
                    Console.WriteLine("<소지품> - 소지한 아이템 정보를 보여준다.");
                    Console.WriteLine("<장비> - 장착한 아이템 정보를 보여준다.");
                    Console.WriteLine("<대상이름> <봐> - 입력한 대상을 살펴본다.");
                    Console.WriteLine("<대상이름> <쳐> - 입력한 대상을 공격한다.");
                    Console.WriteLine("<상태> - 현재 나의 정보를 보여준다.");
                    Console.WriteLine("<보다> - 위치를 확인하고 지금 서있는 곳을 둘러본다.");
                    Console.WriteLine("<도움말> - 그냥도움말은 <명령어>처럼쓴다. <이동> <도움말>도 쓸수 있다.");
                    Console.WriteLine("<끝> - 프로그램을 종료한다.");
                    Console.WriteLine("============================================================================");
                    goto inputCommand;
                }
                if (checkCommand == "지도")
                {
                    Console.WriteLine("============================================================================");
 
                    Console.WriteLine("(1,1)사냥터--------------(1,0)사냥터--------------------(1,-1)사냥터");
                    Console.WriteLine("      |                       |                               |");
                    Console.WriteLine("      |                       |                               |");
                    Console.WriteLine("(0,1)사냥터--------------(0,0)마을-------------------------(0,-1)사냥터");
                    Console.WriteLine("      |                       |                               |");
                    Console.WriteLine("      |                       |                               |");
                    Console.WriteLine("(-1,1)사냥터--------------(-1,0)사냥터--------------------(-1,-1)사냥터");
 
                    Console.WriteLine("============================================================================");
                }
 
                    //퀘스트 수령
                if (checkCommand == "퀘스트 봐")
                {
                    Console.Clear();
                    Console.WriteLine("============================================================================");
                    Console.Write("*   퀘스트 목록은 다음과 같다.");
                    Console.Write("*   1번:"+questName1+"\n*   2번:"+ questName2 + "\n*   3번:"+questName3+"\n*   4번:" + questName4+"\n");
                    Console.WriteLine("============================================================================");
                }
 
                //퀘스트 수령하기
                if (checkCommand == "퀘스트 수락")
                {
                    Console.Clear();
                    resetQuestSelect:
                    Console.WriteLine("수락할 퀘스트 번호를 입력하시오.");
                    Console.Write("이전 메뉴상태로 돌아가려면");
                    ColoredConsoleWrite(ConsoleColor.Yellow, "<뒤로>");
                    Console.WriteLine("를 입력하세요.");
                    ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
                    checkCommand = Console.ReadLine();
                    if (checkCommand == "뒤로"goto inputCommand ;
                    if (questDo == 0)
                    {
 
                        if (checkCommand == "1")
                        {
                            questTotal = 5;
                            questMonsterName = monsterName1;
                            questDo = 1;
                            Console.Write(questName1 + "을 정상적으로 수령 했습니다.");
                        }
                        else if (checkCommand == "2")
                        {
                            questTotal = 10;
                            questMonsterName = monsterName1;
                            questDo = 2;
                            Console.Write(questName2 + "을 정상적으로 수령 했습니다.");
                        }
                        else if (checkCommand == "3")
                        {
                            questTotal = 10;
                            questMonsterName = monsterName2;
                            questDo = 3;
                            Console.Write(questName3 + "을 정상적으로 수령 했습니다.");
                        }
                        else if (checkCommand == "4")
                        {
                            questTotal = 10;
                            questMonsterName = monsterName2;
                            questDo = 4;
                            Console.Write(questName4 + "을 정상적으로 수령 했습니다.");
                        }
                        else
                        {
                            Console.Write("정상적인 퀘스트 번호가 아닙니다.");
                            goto resetQuestSelect;
                        }
                    }
                    else
                    {
                        Console.WriteLine("이미 진행하고 있는 퀘스트가 있습니다.");
                        goto resetQuestSelect;
                    }
 
                }
 
                //완료된 퀘스트 보기
                if (checkCommand.Equals("퀘스트 완료"))
                {
                    Console.Clear();
                    Console.WriteLine("============================================================================");
                    Console.WriteLine(questName1 + " 완료 횟수 : " + questEnd1);
                    Console.WriteLine(questName2 + " 완료 횟수 : " + questEnd2);
                    Console.WriteLine(questName3 + " 완료 횟수 : " + questEnd3);
                    Console.WriteLine(questName4 + " 완료 횟수 : " + questEnd4);
                    Console.WriteLine("============================================================================");
                }
                if (checkCommand.Equals("소지품"))
                {
                    Console.WriteLine("소지품이 없습니다.");
                }
                if (checkCommand.Equals("장비"))
                {
                    Console.WriteLine("장비가 없습니다.");
                }
                if (checkCommand.Contains(" 집다"))
                {
                    Console.WriteLine("집을것이 없습니다.");
                }
                if (checkCommand.Contains(" 버리다"))
                {
                    Console.WriteLine("버릴 것이 없습니다.");
                }
 
                //나의 상태
                if (checkCommand.Equals("상태"))
                {
                    Console.WriteLine("============================================================================");
                    Console.Write("*아이디:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue,userID+ "\n");
                    Console.Write("*닉네임:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userNick+"\n");
                    Console.Write("*성별:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userSX + "\n");
                    Console.Write("*종족:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, user9TName+"("+user9TNumber+")\n");
                    Console.Write("*레벨:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue,userLV+"\n");
                    Console.Write("*경험치:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue,userEXE +"\n");
                    Console.Write("*위치:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue,userWhere +"::");
                    ColoredConsoleWrite(ConsoleColor.Yellow,userXHere + "," + userYHere + "\n");
                    Console.Write("*공격력:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userAP+"\n");
                    Console.Write("*방어력:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userDP+"\n");
                    Console.Write("*체력:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userHP+"\n");
                    Console.Write("*마력:: ");
                    ColoredConsoleWrite(ConsoleColor.DarkBlue, userMP+"\n");
                    if (questEnd1 != 0)
                    {
                        Console.Write("*진행중인 퀘스트:: ");
                        ColoredConsoleWrite(ConsoleColor.DarkBlue,questDoName+"("+questDo+") \n");
                    }
                    Console.WriteLine("============================================================================");
 
                    Console.WriteLine("장비가 없습니다.");
                }
 
                //주변을 살펴보는 보다
                if (checkCommand.Equals("보다"))
                {
                    if (userWhere == "마을")
                    {
                        ColoredConsoleWrite(ConsoleColor.Yellow, "마을");
                        Console.WriteLine("사람들의 북적임으로 정신없다.");
                    }
                    if (userWhere == "사냥터")
                    {
                        ColoredConsoleWrite(ConsoleColor.Yellow, "이곳은 사냥터 \n");
                        if (mapMonster1 != 0)
                        {
                            ColoredConsoleWrite(ConsoleColor.DarkRed, monsterName1);
                            Console.WriteLine("가 "+mapMonster1 + "마리 보입니다.");
                        }
                        if (mapMonster2 != 0)
                        {
                            ColoredConsoleWrite(ConsoleColor.DarkRed, monsterName2);
                            Console.WriteLine("가 " + mapMonster2 + "마리 보입니다.");
                        }
                        if((mapMonster1+monsterPower2)==0Console.WriteLine("아무것도 안보입니다.");
                    }
                }
 
                //동서남북 이동
                if (checkCommand.Equals("동"))
                {
                    if ((userXHere - 1> -2)
                    {
                        userXHere--;
                        Console.WriteLine("동쪽으로 이동했습니다.");
                        if (userXHere == 0 && userXHere == 0) userWhere = "마을";
                        else
                        {
                            userWhere = "사냥터";
                            mapMonster1++;
                            mapMonster2++;
                        }
                    }
                    else Console.WriteLine("동쪽으로 이동할수 없습니다.");
                }
                if (checkCommand.Equals("서"))
                {
                    if ((userXHere + 1< 2)
                    {
                        userXHere++;
                        Console.WriteLine("서쪽으로 이동했습니다.");
                        if (userXHere == 0 && userXHere == 0) userWhere = "마을";
                        else
                        {
                            userWhere = "사냥터";
                            mapMonster1++;
                            mapMonster2++;
                        }
                    }
                    else Console.WriteLine("서쪽으로 이동할수 없습니다.");
                }
                if (checkCommand.Equals("남"))
                {
                    if ((userYHere - 1> -2)
                    {
                        userYHere--;
                        Console.WriteLine("남쪽으로 이동했습니다.");
                        if (userXHere == 0 && userXHere == 0) userWhere = "마을";
                        else
                        {
                            userWhere = "사냥터";
                            mapMonster1++;
                            mapMonster2++;
                        }
                    }
                    else Console.WriteLine("남쪽으로 이동할수 없습니다.");
 
                }
                if (checkCommand.Equals("북"))
                {
                    if ((userYHere + 1< 2)
                    {
                        userYHere++;
                        Console.WriteLine("북쪽으로 이동했습니다.");
                        if (userXHere == 0 && userXHere == 0) userWhere = "마을";
                        else
                        {
                            userWhere = "사냥터";
                            mapMonster1++;
                            mapMonster2++;
                        }
                    }
                    else Console.WriteLine("북쪽으로 이동할수 없습니다.");
 
                }
                //몬스터 봐
               if (checkCommand.Equals("늑대 봐"))
                {
                    if(mapMonster1 != 0)
                    {
                        Console.Write("늑대 체력 ");
                        ColoredConsoleWrite(ConsoleColor.DarkRed,monsterHP1+"" );
                        Console.Write("늑대 공격력 ");
                        ColoredConsoleWrite(ConsoleColor.DarkRed, monsterPower1 + "\n");
                    }
                    else Console.WriteLine("늑대 가 없습니다");
 
                }
                if (checkCommand.Equals("곰 봐"))
                {
                    if (mapMonster2 != 0)
                    {
                        Console.Write("곰 체력 ");
                        ColoredConsoleWrite(ConsoleColor.DarkRed, monsterHP2 + "");
                        Console.Write("곰 공격력 ");
                        ColoredConsoleWrite(ConsoleColor.DarkRed, monsterPower1 + "\n");
                    }
                    else Console.WriteLine("곰 이 없습니다");
                }
                //늑대 공격
                if (checkCommand.Equals("늑대 쳐"))
                {
                    if (mapMonster1 > 0)
                    {
                        while (userHP > 0)
                        {
                            Console.WriteLine("늑대를 공격합니다.");
                            monsterHP1 -= userAP;
                            Console.Write("늑대 체력이 ");
                            ColoredConsoleWrite(ConsoleColor.DarkRed, monsterHP1 + "");
                            Console.WriteLine(" 남았습니다.");
                            if (monsterHP1 <= 0break;
                            Console.WriteLine("늑대가 공격합니다.");
                            userHP -= (monsterPower1 - userDP);
                            Console.Write(userNick+ "님의 체력이 ");
                            ColoredConsoleWrite(ConsoleColor.DarkRed, userHP + "");
                            Console.WriteLine(" 남았습니다.");
                        }
                        if (monsterHP1 <= 0)
                        {
                            Console.WriteLine("늑대를 잡았습니다.");
                            Console.WriteLine("체력을 회복합니다.");
                            Console.Write("경험치 ");
                            ColoredConsoleWrite(ConsoleColor.DarkBlue, monsterExe1 + "");
                            Console.Write(" 획득\n");
                            mapMonster1--;
                            userEXE += monsterExe1;
                            userHP += (300 - userHP);
                            monsterHP1 = 70;
                            if(questDo==1||questDo == 2)
                            {
                                quest1Save++;
                                if((questTotal - quest1Save)>0Console.WriteLine ("늑대를 총 "+(questTotal-quest1Save)+"마리더 잡아야 됩니다.");
                                else
                                {
                                    ColoredConsoleWrite(ConsoleColor.DarkGreen, "늑대를 다잡았다!!!\n");
                                    Console.WriteLine("퀘스트 완료!!");
                                    if (questDo == 1) questEnd1++;
                                    if (questDo == 2) questEnd2++;
                                    if (questDo == 3) questEnd3++;
                                    if (questDo == 4) questEnd4++;
                                    questDo = 0;
                                }
                            }
                        }
                        else
                        {
                            Console.WriteLine("사망 하였습니다.");
                            Console.WriteLine("마을로 이동합니다.");
                            userHP += (300 - userHP);
                            userYHere = 0;
                            userXHere = 0;
                            userWhere = "마을";
                        }
                    }
                    else Console.WriteLine("공격할 늑대가 없습니다.\n");
                }
 
                //곰 공격
                if (checkCommand.Equals("곰 쳐"))
                {
                    if (mapMonster2 > 0)
                    {
                        while (userHP > 0)
                        {
                            Console.WriteLine("곰을 공격합니다.");
                            monsterHP2 -= userAP;
                            Console.Write("곰 체력이 ");
                            ColoredConsoleWrite(ConsoleColor.DarkRed, monsterHP2 + "");
                            Console.WriteLine(" 남았습니다.");
                            if (monsterHP2 <= 0break;
                            Console.WriteLine("곰이 공격합니다.");
                            userHP -= (monsterPower2 - userDP);
                            Console.Write(userNick + "님의 체력이 ");
                            ColoredConsoleWrite(ConsoleColor.DarkRed, userHP + "");
                            Console.WriteLine(" 남았습니다.");
                        }
                        if (monsterHP1 <= 0)
                        {
                            Console.WriteLine("곰을 잡았습니다.");
                            Console.WriteLine("체력을 회복합니다.");
                            Console.Write("경험치 ");
                            ColoredConsoleWrite(ConsoleColor.DarkBlue, monsterExe2 + "");
                            Console.Write(" 획득\n");
                            mapMonster2--;
                            userEXE += monsterExe2;
                            userHP += (300 - userHP);
                            monsterHP2 = 170;
                            if (questDo == 3 || questDo == 4)
                            {
                                quest1Save++;
                                if ((questTotal - quest1Save) > 0Console.WriteLine("곰을 총 " + (questTotal - quest1Save) + "마리더 잡아야 됩니다.");
                                else
                                {
                                    ColoredConsoleWrite(ConsoleColor.DarkGreen, "곰을 다잡았다!!!\n");
                                    Console.WriteLine("퀘스트 완료!!");
                                    if (questDo == 1) questEnd1++;
                                    if (questDo == 2) questEnd2++;
                                    if (questDo == 3) questEnd3++;
                                    if (questDo == 4) questEnd4++;
                                    questDo = 0;
                                }
                            }
 
                        }
                        else
                        {
                            Console.WriteLine("사망 하였습니다.");
                            Console.WriteLine("마을로 이동합니다.");
                            userHP += (300 - userHP);
                            userYHere = 0;
                            userXHere = 0;
                            userWhere = "마을";
                        }
                    }
                    else Console.WriteLine("공격할 곰이 없습니다.");
                }
 
 
                if (checkCommand.Equals("위")) Console.WriteLine("위쪽으로 이동할수 없습니다.");
                if (checkCommand.Equals("밑")) Console.WriteLine("밑쪽으로 이동할수 없습니다.");
 
 
                //이동 도움말
                if (checkCommand.Equals("이동 도움말"))
                {
                    Console.WriteLine("-이동에 관한 명령어");
                    Console.WriteLine("============================================================================");
                    Console.WriteLine("* 설명 : 한 장소에서 인접한 다른 장소로 이동할 때 사용되는 명령입니다.");
                    Console.WriteLine("이동을 하기 위새서는 현재 장소에서 해당 방향으로 나가는 출구가 존재해야 합니다.");
                    Console.WriteLine("* 동 - 동쪽으로 이동합니다.");
                    Console.WriteLine("* 서 - 서쪽으로 이동합니다.");
                    Console.WriteLine("* 남 - 남쪽으로 이동합니다.");
                    Console.WriteLine("* 북 - 북쪽으로 이동합니다.");
                    Console.WriteLine("* 위 - 위쪽으로 이동합니다.");
                    Console.WriteLine("* 밑 - 밑쪽으로 이동합니다.");
                    Console.WriteLine("* 출구 - 현재 장소에서 이동할수 있는 방향과 장소를 보여줍니다.");
                    Console.WriteLine("============================================================================");
 
                }
                 
 
 
 
                //종료진행
                if (checkCommand == "끝")
                {
                    reEnd:
                    Console.WriteLine("[ENTER]를 눌러 종료 하세요.");
                    inputKey = Console.ReadKey();
                    ClearCurrentConsoleLine();
                    //엔터 확인
                    if (inputKey.Key != ConsoleKey.Enter) goto reEnd;
                    else
                    {
                        Console.Clear();
                        Console.WriteLine("정상적으로 종료되었습니다.");
                        Console.WriteLine("한번더 아무키나 입력하시면 창이 닫힙니다.");
                        mainLoopCheck = false;
                        goto outLoop;
 
                    }
                }
 
 
 
 
 
 
                inputCommand:
                Console.WriteLine("명령어를 대기하고 있습니다.");
                Console.Write("명령어에 대해 필요하다면 ");
                ColoredConsoleWrite(ConsoleColor.Yellow, "<명령어>");
                Console.WriteLine("라고 입력 하세요.");
                ColoredConsoleWrite(ConsoleColor.DarkYellow, ":>");
                checkCommand = Console.ReadLine();
                outLoop:;
            }
 
 
            Console.WriteLine("");
            Console.ReadKey();
 
 
출처: http://2god.tistory.com/50?category=725029 [To.]
 
cs