c언어를 이용한 바둑 프로그램, 바둑 소스
본 자료는 4페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
해당 자료는 4페이지 까지만 미리보기를 제공합니다.
4페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

c언어를 이용한 바둑 프로그램, 바둑 소스에 대한 보고서 자료입니다.

본문내용

SIZE || y<0 || y>=MAPSIZE) return OK;
if(xy[y][x]==OtherPlayer) return OK;
if(xy[y][x]==NONE) return NO;
cnt=0;
result=NO;
map[y][x]=OK;
if(TestFlag(x,y-1)==FLAGFALSE) {
if(SefeDeleteTest(x,y-1,OtherPlayer)) {
cnt=cnt + 1;
}
} else {
cnt=cnt+1;
}
if(TestFlag(x-1,y)==FLAGFALSE) {
if(SefeDeleteTest(x-1,y,OtherPlayer)) {
cnt=cnt + 1;
}
} else {
cnt=cnt+1;
}
if(TestFlag(x+1,y)==FLAGFALSE) {
if(SefeDeleteTest(x+1,y,OtherPlayer)) {
cnt=cnt + 1;
}
} else {
cnt=cnt+1;
}
if(TestFlag(x,y+1)==FLAGFALSE) {
if(SefeDeleteTest(x,y+1,OtherPlayer)) {
cnt=cnt + 1;
}
} else {
cnt=cnt+1;
}
if(IsKill(cnt)){
result=OK;
}
return result;
}
void DolDelete(int x,int y,int OtherPlayer)
{
if(x<0 || x>=MAPSIZE || y<0 || y>=MAPSIZE) return;
if(xy[y][x]==OtherPlayer) return;
if(xy[y][x]==NONE) return;
xy[y][x]=CLEAR;
if(x+1 if(x-1>=0) DolDelete(x-1,y,OtherPlayer);
if(y+1 if(y-1>=0) DolDelete(x,y-1,OtherPlayer);
}
void RalDeleteTest(int x,int y,int OtherPlayer)
{
clearValue();
if(SefeDeleteTest(x+1,y,OtherPlayer)==YES)
DolDelete(x+1,y,OtherPlayer);
clearValue();
if(SefeDeleteTest(x-1,y,OtherPlayer)==YES)
DolDelete(x-1,y,OtherPlayer);
clearValue();
if(SefeDeleteTest(x,y+1,OtherPlayer)==YES)
DolDelete(x,y+1,OtherPlayer);
clearValue();
if(SefeDeleteTest(x,y-1,OtherPlayer)==YES)
DolDelete(x,y-1,OtherPlayer);
}
void input(int Player)
{
char c;
int LOOP=START;
int OtherPlayer;
if(Player == PLAYER1) {
OtherPlayer = PLAYER2;
} else {
OtherPlayer = PLAYER1;
}
while(LOOP!=END){
c = getch();
switch(c)
{
case RIGHT:
x=x+1;
if(x >= MAPSIZE) x=x-1;
gotoxy(x,y);
break;
case LEFT:
x=x-1;
if(x < 0 ) x=x+1;
gotoxy(x,y);
break;
case UP:
y=y-1;
if(y < 0 ) y=y+1;
gotoxy(x,y);
break;
case DOWN:
y=y+1;
if(y >= MAPSIZE ) y=y-1;
gotoxy(x,y);
break;
case ENTER:
if(xy[y][x] != NONE ) break;
xy[y][x]=Player;
RalDeleteTest(x,y,Player);
clearValue();
if(SefeDeleteTest(x,y,OtherPlayer)==YES){
xy[y][x]=CLEAR;
} else {
LOOP = END;
}
}
}
}
void printScreen()
{
system("cls");
int x,y,n;
char c[3];
for(y=0;y for(x=0;x if(xy[y][x] == PLAYER1) {
printf("○");
} else if(xy[y][x] == PLAYER2 ) {
printf("●");
} else if(xy[y][x] == NONE ) {
n=(x+16)/17+(y+16)/17*3;
c[0]=mapChar[n*2];
c[1]=mapChar[n*2+1];
c[2]=0;
if((x-3)%6==0 && (y-3)%6==0) {
strcpy(c,"×");
}
printf("%s",c);
}
}
printf("\n");
}
gotoxy(displayX,displayLineY);
printf("UP:T DOWN:G LEFT:F RIGHT:H ENTER:Q");
}
int gamePlayCheck(int Player)
{
return 1;
}
void InitMapData()
{
int x,y;
for(y=0;y for(x=0;x xy[y][x]=CLEAR;
}
}
}
void SetCursorShow(void)
{
HANDLE hConsole;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO ci;
GetConsoleCursorInfo( hConsole, &ci );
ci.dwSize=100;
ci.bVisible = TRUE;
SetConsoleCursorInfo( hConsole , &ci );
}
void gotoxy(int x , int y)
{
COORD Pos = { x*2 , y};
SetConsoleCursorPosition(GetStdHandle( STD_OUTPUT_HANDLE), Pos);
}
  • 가격2,000
  • 페이지수14페이지
  • 등록일2006.12.13
  • 저작시기2006.7
  • 파일형식한글(hwp)
  • 자료번호#382447
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니