'설계' 태그의 글 목록
본문 바로가기
728x90
반응형

설계4

2021.10.09_20061-모노미노도미노2 소스코드 #include #include #include #include using namespace std; #define SIZE 10 int blue[4][SIZE]; int green[SIZE][4]; int N; int t, x, y; int score, finalCnt; void init();//초기화 및 초기 입력 void gamePlay();//게임 시작 int main(void) { int testCase = 1; for (int tc = 1; tc = 2; y--) { green[y][0] = green[y - cnt][0]; green[y][1] = green[y - cnt][1]; green[y][2] = green[y - cnt][2]; green[y][3] = green[y - .. 2021. 10. 10.
2021.10.02_19236-청소년상어 소스코드 #include #include #include #include #include using namespace std; #define SIZE 4 #define FISHES_SIZE 17 struct Data { int y, x, dir; }; Data fishes[FISHES_SIZE]; Data shark;//상어 정보 int dy[] = { -1,-1,0,1,1,1,0,-1 }; int dx[] = { 0,-1,-1,-1,0,1,1,1 }; int board[SIZE][SIZE];//입력 int answer;//결과값 void init();//초기화 및 입력 bool safeZone(int y, int x);//보드 범위 체크 void moveShark(int y, int x, int sum.. 2021. 10. 2.
2021.09.28_17825_주사위윷놀이 소스코드 #include #include #include #include #include using namespace std; #define S 10 int cube[S];//주사위나온 수 저장 배열 int ret;//결과값 저장변수 int D[S];//1번말 부터 4번말 까지 존재 int B[33] = { 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,-1, 13,16,19,25,22,24,28,27,26,30,35 };//보드의 값 저장 struct Data { int idx, pidx;//현재의 인덱스 값과 이전의 인덱스값 }; void init_input() {//초기화 및 초기 입력 //초기화 ret = 0x80000000;//최소값 저장.. 2021. 9. 30.
2021.09.16_15685-드래곤커브 소스코드 #include #include #include #include using namespace std; #define MAX_SIZE 104 int board[MAX_SIZE][MAX_SIZE]; int dy[] = { 0,-1,0,1 }; int dx[] = { 1,0,-1,0 }; int N; int answer; void init();// 초기화 void dragon();//드래곤 커브 int main(void) { int testCase = 1; for (int tc = 1; tc =0; dir_idx--) { dir.push_back((dir[dir_idx]+1) % 4); } } board[y][x] = 1; for (int dir_idx = 0; dir_idx < dir.size();.. 2021. 9. 16.
728x90
반응형