[C/C++] Task08 (미로찾기 게임)
본 자료는 미리보기를 지원하지 않습니다.
닫기
  • 1
  • 2
  • 3
해당 자료는 1페이지 까지만 미리보기를 제공합니다.
1페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[C/C++] Task08 (미로찾기 게임)에 대한 보고서 자료입니다.

목차

main.cpp                   2.47KB
Task08(미로찾기).sln            905바이트
Task08(미로찾기).vcproj           3.51KB

본문내용

#include
using namespace std;

//==============================================================================//
// ※ 미로찾기 (파일처리)
// - 콘솔을 이용한 간단한 미로찾기 게임을 만들어보자.
// - 학습내용 :
// 파일을 읽고 쓰는 법 / 콘솔모드에서 커서 이동법 / 2배열 포인터 넘기기
//==============================================================================//

#include
#include

#define MAP_X 20
#define MAP_Y 10
#define LEFT 75
#define RIGHT 77
#define UP 72
#define DOWN 80
#define ESC 27

// 커서이동 //
void MoveCursor(int x, int y)
{
COORD Cur;

Cur.X = x;
Cur.Y = y;

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Cur);
}

// 맵이동가능 체크 //
int MoveCheck(int (*iMap)[MAP_X], int player_y, int player_x)
{
return *(*(iMap+player_y)+player_x) ? 0:1;
}

// 맵로드 //
bool LoadMap(int (*iMap)[MAP_X])
{
FILE* fRead;

fopen_s(&fRead, "File\\map.txt", "r");

if(!(fRead))
{
printf("맵을 로드하지 못하였습니다.\n");
return false;
}
for(int iLoop1=0; iLoop1 {
for(int iLoop2=0; iLoop2 {
if(*(*(iMap+iLoop1)+iLoop2) = fgetc(fRead)-'0')
printf("#");
else
printf(" ");
}
fgetc(fRead);
puts("");
}
fclose(fRead);
MoveCursor(MAP_X-2, MAP_Y-2);
printf("G");
return true;
}

키워드

미로찾기,   C,   C++,   프로그램
  • 가격500
  • 페이지수3페이지
  • 등록일2011.07.26
  • 저작시기2010.9
  • 파일형식압축파일(zip)
  • 자료번호#691219
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니