Skip to content

숫자 야구#1

Open
chenghaLim wants to merge 2 commits intomainfrom
feat1
Open

숫자 야구#1
chenghaLim wants to merge 2 commits intomainfrom
feat1

Conversation

@chenghaLim
Copy link
Owner

숫자 야구 게임

Comment on lines +12 to +15
Computer computer = new Computer();
Player player = new Player();
Judge judge = new Judge();
Playagain playagain = new Playagain();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

객체를 잘 나눠 구현해서 보기가 편하네요

private int strike;


public Count(List<Integer> player, List<Integer> computer) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Player, Computer로 파라미터를 받았으면 의사표현이 더 잘될것 같아요

List<Integer> computers = computer.numlist();
String result = "";
while (!result.equals("3스트라이크")){
result = judge.judge(player.insert(),computers);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

judge.judge(), playagain.playagain() 내용이 겹쳐서 judge.기능명()으로 표현하는건 어떨까요?

List<Integer> list = new ArrayList<>();
boolean current = true;
// while(current){
for (char c : input.toCharArray()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사용하지 않는 변수와 코드 정렬은 해주는게 좋아요...

}


public List<Integer> insert() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

한 메서드에 기능이 많아 분리하면 좋을거 같아요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants