Skip to content

Commit

Permalink
KUR GONU
Browse files Browse the repository at this point in the history
1학년 1학기에 만든 C 콘솔 게임. 깃헙에 처음으로 업로드
  • Loading branch information
KUR-creative committed Aug 9, 2016
1 parent 2af865d commit 410d4fe
Show file tree
Hide file tree
Showing 514 changed files with 16,406 additions and 0 deletions.
15 changes: 15 additions & 0 deletions KUR GONU/KUR GONU pseudo code.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
KUR's GONU

��##########��##########��
## # ##
# ## # ## #
# #######��####### #
# # ## # ## # #
# # ## # ## # #
#######################
# # ## # ## # #
# # ## # ## # #
# #######��####### #
# ## # ## #
## # ##
��##########��##########��
Binary file added KUR GONU/KUR GONU reworked/Debug/KUR GONU.exe
Binary file not shown.
Binary file added KUR GONU/KUR GONU reworked/Debug/KUR GONU.ilk
Binary file not shown.
Binary file added KUR GONU/KUR GONU reworked/Debug/KUR GONU.pdb
Binary file not shown.
Binary file not shown.
Binary file added KUR GONU/KUR GONU reworked/KUR GONU.sdf
Binary file not shown.
20 changes: 20 additions & 0 deletions KUR GONU/KUR GONU reworked/KUR GONU.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KUR GONU", "KUR GONU\KUR GONU.vcxproj", "{AE99F448-BF7E-43D8-95A6-8D9F1923273E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AE99F448-BF7E-43D8-95A6-8D9F1923273E}.Debug|Win32.ActiveCfg = Debug|Win32
{AE99F448-BF7E-43D8-95A6-8D9F1923273E}.Debug|Win32.Build.0 = Debug|Win32
{AE99F448-BF7E-43D8-95A6-8D9F1923273E}.Release|Win32.ActiveCfg = Release|Win32
{AE99F448-BF7E-43D8-95A6-8D9F1923273E}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Binary file added KUR GONU/KUR GONU reworked/KUR GONU.suo
Binary file not shown.
189 changes: 189 additions & 0 deletions KUR GONU/KUR GONU reworked/KUR GONU/ConsoleGraphics.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/***************************************************
*콘솔 게임용 그래픽 출력 함수들.
*
* Graph ADT.h, GameData.h를 사용하는 부분을 없애면
* 좀 더 일반적인 콘솔 게임에 사용 가능.
*
*만든놈 : KUR
* https://www.facebook.com/KURcreative
* kur941017@gmail.com
*
*********************************************/

#include "ConsoleGraphics.h"
#include "GraphADT.h"
#include "GameData.h"


//현재 커서를 x,y 좌표로 옮기는 함수.
//만일 x나 y중 하나의 값이라도 현재 콘솔의 화면 버퍼 크기를 넘어서면 작동을 안함.
void gotoXY(int x, int y)
{
COORD coordinates = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coordinates);
}

//현재 커서를 Point변수의 (x,y)로 옮겨주는 함수
//input : 커서를 옮기고 싶은 좌표값을 가진 Point변수의 주소
void gotoPoint(const Point *pos)
{
COORD coordinates = {pos->x, pos->y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coordinates);
}

void printPoint(Point* pos, char ch)
{
gotoPoint(pos);
_putch(ch);
}

//현재 출력하려는 텍스트의 색과 배경색을 설정하는 함수.
/*
색깔 숫자
검정 0
어두운 파랑 1
어두운 초록 2
어두운 하늘 3
어두운 빨강 4
어두운 보라 5
어두운 노랑 6
회색 7
어두운 회색 8
파랑 9
초록 10
하늘 11
빨강 12
보라 13
노랑 14
하양 15
*/
void setColor(int txt, int back)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 16*back + txt);
}

//반올림 함수. 입력한 값을 소수 첫째자리에서 반올림하여 정수값으로 만든다.
int round(double num)
{
if(num >= 0) return (int)(num + 0.5);
else return (int)(num - 0.5);
}

//두 Point변수의 주소를 입력하면 (두 좌표가 형성하는) 선분 위의 모든 좌표들에 입력한 문자변수ch를 출력한다.
//이 때 두 좌표 그 자체에도 ch가 출력된다.(선분을 이루는 점까지 출력)
void drawLine(Point *p1, Point *p2, char ch)
{

int x1 = (p1->x), y1 = (p1->y); //p1
int x2 = (p2->x), y2 = (p2->y); //p2
//일차함수 y = a*x + b
float a;//기울기
float b;//y절편

int length;//length는 선분의 길이. 선분을 이루는 점까지 포함한다.
int i, temp;

if(x1 == x2 && y1 == y2){
gotoXY(x1, y1);
_putch(ch);
return;
}

if(x2 - x1){
a = (float)(y2 - y1) / (float)(x2 - x1);
b = (float)y1 - a*(float)x1;
}else{//기울기가 무한일 때의 예외처리.( /0 처리)

length = y2 - y1;//x값 차이는 0이기에 y기준으로 출력된다.
temp = abs(length);

if(length > 0){
for(i = 0; i <= temp; i++){//두 점까지 포함시키기 위해 0~length까지다.
gotoXY( x1, y1+i );//x값은 y=ax+b에서 x를 묶어내어 x=(y-b)/a이다.
_putch(ch);
}
}else{
for(i = 0; i <= temp; i++){
gotoXY( x1, y2+i );
_putch(ch);
}
}

return;
}

//좌표간의 차이가 큰 놈으로 출력한다. 그래야 점선이 출력되지 않는다.
if( abs(x2 - x1) > abs(y2 - y1) ){ //x기준 출력
length = x2 - x1; //'선분+두 점'의 길이보다 1이 작다.
temp = abs(length);

if(length > 0){
float pre = a*x1 + b;

for(i = 0; i <= temp; i++){//두 점까지 포함시키기 위해 0~length까지다.
gotoXY(x1+i, round( pre + a*i ) );//y값은 일차식 y=ax+b를 내린 값이다.

_putch(ch);
}
}else{
float pre = a*x2 + b;

for(i = 0; i <= temp; i++){
gotoXY(x2+i, round( pre + a*i ) );
_putch(ch);
}
}
}else{ //y기준 출력
length = y2 - y1;
temp = abs(length);

if(length > 0){
for(i = 0; i <= temp; i++){//두 점까지 포함시키기 위해 0~length까지다.
gotoXY( round( (y1+i - b)/a ), y1+i );//x값은 y=ax+b에서 x를 묶어내어 x=(y-b)/a이다.
_putch(ch);
}
}else{
for(i = 0; i <= abs(length); i++){
gotoXY( round( (y2+i - b)/a ), y2+i );
_putch(ch);
}
}
// a==0일때의 예외처리가 필요 없는 이유가, a==0일 때는 y가 같을 때인데 이때는 x를 기준으로 출력하기 때문이다. 이쪽 블럭으로는 오지도 않는다는 말.
}

}

//빈 사각형을 대입한 값에 따라 만든다.
void printSquare(int startX, int startY, int width, int height, char ch)
{
int i;

for(i = 0; i <= width; i++){// 두개의 세로선 긋기
gotoXY(startX + i, startY);
putchar(ch);
gotoXY(startX + i, startY + height);
putchar(ch);
}
for(i = 0; i <= height; i++){// 두개의 가로선 긋기
gotoXY(startX, startY + i);
putchar(ch);
gotoXY(startX + width, startY + i);
putchar(ch);
}

}

//꽉 찬 사각형을 대입한 값에 따라 만든다.
void printFullSquare(int startX, int startY, int width, int height, char ch)
{
int x, y;

for(y = 0; y <= height; y++){
for(x = 0; x <= width; x++){
gotoXY(startX + x, startY + y);
putchar(ch);
}
}

}
55 changes: 55 additions & 0 deletions KUR GONU/KUR GONU reworked/KUR GONU/ConsoleGraphics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#ifndef _CONSOLE_GRAPHICS_H_
#define _CONSOLE_GRAPHICS_H_

#ifndef _INC_STDIO
# include <stdio.h>
#endif

#ifndef _WINDOWS_
# include <Windows.h>
#endif

#ifndef _INC_CONIO
# include <conio.h>
#endif

#ifndef _INC_MATH
# include <math.h>
#endif


typedef struct Point { //좌표 하나를 나타내는 구조체
int x;
int y;
} Point;

void gotoXY(int x, int y); //Window.h
void setColor(int txt, int back); //Window.h
void gotoPoint(const Point *pos); //Window.h, Point
void drawLine(Point *p1, Point *p2, char ch); //Window.h, conio.h, math.h, Point, gotoXY, round()
int round(double num); //없음!
void printPoint(Point* pos, char ch);
void printSquare(int startX, int startY, int width, int height, char ch);
void printFullSquare(int startX, int startY, int width, int height, char ch);


enum colors{
BLACK,
DARK_BLUE,
DARK_GREEN,
DARK_AZURE,
DARK_RED,
DARK_PURPLE,//5
DARK_YELLOW,
GRAY,
DARK_GRAY,
BLUE,
GREEN,//10
AZURE,
RED,
PURPLE,
YELLOW,
WHITE,//15
};

#endif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#v4.0:v100
Debug|Win32|C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\|
46 changes: 46 additions & 0 deletions KUR GONU/KUR GONU reworked/KUR GONU/Debug/KUR GONU.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
빌드 시작: 2015-08-09 오후 8:04:58
1>2 노드의 "C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\KUR GONU\KUR GONU.vcxproj" 프로젝트(build 대상)입니다.
1>InitializeBuildStatus:
"AlwaysCreate"이(가) 지정되었기 때문에 "Debug\KUR GONU.unsuccessfulbuild"을(를) 만들고 있습니다.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Debug\\" /Fd"Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt MainGame.c
MainGame.c
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\stack.h(10): warning C4005: 'TRUE' : 매크로 재정의
c:\program files (x86)\microsoft sdks\windows\v7.0a\include\windef.h(72) : 'TRUE'의 이전 정의를 참조하십시오.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(1376): warning C4996: 'putch': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putch. See online help for details.
c:\program files (x86)\microsoft visual studio 10.0\vc\include\conio.h(135) : 'putch' 선언을 참조하십시오.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(1403): warning C4996: 'putch': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _putch. See online help for details.
c:\program files (x86)\microsoft visual studio 10.0\vc\include\conio.h(135) : 'putch' 선언을 참조하십시오.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(332): warning C4715: 'turn' : 모든 제어 경로에서 값을 반환하지는 않습니다.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(450): warning C4715: 'inputRoutine' : 모든 제어 경로에서 값을 반환하지는 않습니다.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(671): warning C4715: 'inputForSelect' : 모든 제어 경로에서 값을 반환하지는 않습니다.
1>c:\users\ko u ram\desktop\c practice and projects\mine\kur gonu\kur gonu reworked\kur gonu\maingame.c(1007): warning C4715: 'inputForMove' : 모든 제어 경로에서 값을 반환하지는 않습니다.
ManifestResourceCompile:
모든 출력이 최신 상태입니다.
Link:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\Debug\KUR GONU.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:"Debug\KUR GONU.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\Debug\KUR GONU.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\Debug\KUR GONU.lib" /MACHINE:X86 "Debug\KUR GONU.exe.embed.manifest.res"
Debug\gonuDebug.obj
Debug\Rull.obj
Debug\Stack.obj
Debug\ConsoleGraphics.obj
Debug\GameData.obj
Debug\MainGame.obj
Debug\MenuAndUI.obj
Debug\GraphADT.obj
Debug\Main.obj
Debug\GonuInput.obj
Debug\StringQueue.obj
Manifest:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:"Debug\KUR GONU.exe.embed.manifest" /manifest "Debug\KUR GONU.exe.intermediate.manifest"
모든 출력이 최신 상태입니다.
LinkEmbedManifest:
모든 출력이 최신 상태입니다.
KUR GONU.vcxproj -> C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\Debug\KUR GONU.exe
FinalizeBuildStatus:
"Debug\KUR GONU.unsuccessfulbuild" 파일을 삭제하고 있습니다.
"Debug\KUR GONU.lastbuildstate"에 연결(touching)하고 있습니다.
1>"C:\Users\Ko U Ram\Desktop\c Practice and Projects\Mine\KUR GONU\KUR GONU reworked\KUR GONU\KUR GONU.vcxproj" 프로젝트를 빌드했습니다(build 대상).

빌드했습니다.

경과 시간: 00:00:01.63
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Loading

0 comments on commit 410d4fe

Please sign in to comment.