Open
Conversation
- 구현해야 할 기능 목록 작성
- 필요한 변수 및 함수 선언
- 턴을 기록하기 위한 변수 turn 선언 - 바둑판의 각 그리드에 어떤 돌이 놓였는 지 기록하기 위한 이차원 배열 table 선언 - placeStone 함수 구현. 흑 선
- updateBoardState - 해당 그리드가 빈 칸이면 0(기본값), 흑이 놓이면 1, 백이 놓이면 2로 초기화
- 방금 둔 돌을 기준으로 좌/우/대각선에 5개 이상의 돌이 놓일 시 승리 감지 - countStones: 자기 자신을 포함해 몇 개의 돌이 연속으로 놓였는 지 계산하는 함수 - countDirection: 해당 방향으로 몇 개의 돌이 연속으로 놓였는 지 계산하는 함수 checkWin: (0,1),(1,0),(1,1),(1,-1) 방향 중 한 방향이라도 5개 이상의 돌이 놓였다면 true를 리턴하는 함수(승리 감지)
- 매 턴마다 승리 감지 로직이 작동한 결과로 true를 리턴하면 게임 종료 - Yes 클릭 시: 현재 액티비티 끝내고 액티비티 재실행(intent 이용) - No 클릭 시: 액티비티 종료
- placeStone 함수의 결과 올바른 위치에 돌이 놓이는 지 확인 - Dialog가 올바르게 작동하는 지 확인 - 재시작 로직, 종료 로직 작동 확인
- 마크다운 양식 적용
- 기존 프로젝트와 동일하게 설정
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
감사합니다!