-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Damagucci-Juice] step4-2 족보를 구현해 패를 내놓음 #115
Open
Damagucci-Juice
wants to merge
25
commits into
codesquad-members-2022:gucci
Choose a base branch
from
Damagucci-Juice:poker-step4-2
base: gucci
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Damagucci-Juice] step4-2 족보를 구현해 패를 내놓음 #115
Damagucci-Juice
wants to merge
25
commits into
codesquad-members-2022:gucci
from
Damagucci-Juice:poker-step4-2
Conversation
This file contains 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.
구현 내용
Player 와 Dealer 가 Participant 를 채택하도록 설정
고민과 해결
1. 가지고 있는 패를 어떻게 나타낼까?
Computer 클래스를 어떤 식으로 구현해야할지 감을 못잡음
Participant 안에 로직을 구현하려하다가 Computer 클래스에 이관하였고, 속성값으로 어떤 패를 가지는지 확인하는 속성을 설정하였다.
패를 전체 가지고 있는 모습을 보여주는 타입을 어떻게 하면 좋을까 하다가 딕셔너리 형식으로 구현하였다.
let shapeRankTable : [Shape, [Int]]
Rank 는 배열의 인덱스로 표현하였다.
위는 7 카드 스터드 예시
2. 연산 프로퍼티에 너무 과한 계산을 넣은게 아닌가 하는 문제
3. 같은 족보의 패가 나왔을 때, 승자를 가리는 로직을 구현하지 못했다.
위 사진은 flush 일 때 딜러가 다이아몬드라 이겨야 하는데, 하트 플러쉬인 크롱이 이긴모습
이런 식으로 구현은 했는데, 이 때 나누는 방법이 two pair 일때 다르고, one pair일 때 다르고, flush 일때 다르고, straight 일 때 다르게 구현해야해서 어느 정도 시간을 넣으면 하긴 할 거같은데, 일단은 코드 제출을 위해 여기까지는 구현하지 못했다.