-
Notifications
You must be signed in to change notification settings - Fork 0
[숫자 야구 게임] cactus - MVC 패턴 적용 #2
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
Open
ehlung
wants to merge
32
commits into
main
Choose a base branch
from
cactus
base: main
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
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
f9b5675
feat: 랜덤으로 정답값 생성
ehlung 9bc9553
feat: 유효성 검사 로직
ehlung aa6507c
refactor: 유틸 함수들을 BaseballGame 객체의 메서드로 통합
ehlung 6be6a2d
feat: 버튼 요소 수정
ehlung 012e2bc
feat: index.js 작성
ehlung fc0ed91
refactor: userInputValue 배열로 받아서 넣기
ehlung 3ac145b
refactor: userInputValue 배열 타입 변환 추가 (에러 방지)
ehlung 89bbd10
refactor: Random 라이브러리 호출 방법 오류 수정
ehlung 60d0ec2
refactor: 문법 및 자잘한 오류 수정(1주차 최종)
ehlung 4088b5f
chore: package-lock.json 업데이트
ehlung 771e62e
refactor: BaseballGame 함수의 play 메서드에서 문자열 변환 로직 제거 (MVC 패턴 적용)
ehlung d9a66fb
refactor: View.js 생성 (MVC 패턴 적용)
ehlung 5a91c51
refactor: index.js 네이밍 Controller.js로 변경 및 View와 Controller 역할 분리 (MV…
ehlung 2405a5b
fix: View 인스턴스 생성 및 교체
ehlung afbfa33
fix: getInputValue 메서드 형태로 호출 수정
ehlung 6173de9
fix: 최종 문자열 로직 수정 (let 사용, finalResultString 값 할당 수정, 배열의 길이를 검사해야 함.…
ehlung 31e0e15
refactor: DOM 요소 const 로컬 변수 선언 -> this. 인스턴스 속성 정의 방식 변경
ehlung 25f6ce1
chore: 파일 이름 변경 수정
ehlung f6d2d61
docs: 개인 미션 수행 README.md 작성
ehlung 867a904
Update src/View.js
ehlung 72d466d
refactor: DOM 요소 변수명에 $ 접두사 추가
ehlung 0ab2ef2
refactor: 매직넘버 상수 네이밍 컨벤션 적용
ehlung 6b79a95
refactor: ERROR_MESSAGE 상수 Model에서 export 및 Controller import 적용
ehlung ff6373d
refactor: Model 유효값 검증 로직 개선(문자열 타입으로 검사), 입력값의 검증 이후 가공해 게임 실행 수정
ehlung e7c359f
refactor: 문자열 변환 로직 Controller → Model로 이동
ehlung 0b13890
refactor: 정답 판별 로직 MVC 패턴 정확히 분리 및 결합도 낮추기
ehlung 5137620
fix: 성공 메서드 호출 안함 수정
ehlung 71475f1
refactor: 변수명을 더 직관적으로 수정
ehlung 0027e73
docs: README 형식 통일 및 내용 수정
ehlung 07b09e3
docs: README에 과거 코드와의 비교 내용 추가 작성
ehlung 89e23d9
docs: REAMEME 양식통일 수정
ehlung 4b7245d
Update README.md
ehlung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,28 @@ | ||
| <!DOCTYPE html> | ||
| <!doctype html> | ||
| <html lang="ko"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>숫자 야구 게임</title> | ||
| </head> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>숫자 야구 게임</title> | ||
| </head> | ||
|
|
||
| <body> | ||
| <div id="app"> | ||
| <h1>⚾ 숫자 야구 게임</h1> | ||
| <p> | ||
| <strong>1~9까지의 수</strong>를 중복없이 | ||
| <strong>3개</strong> 입력해주세요. <br /> | ||
| 올바른 예) 139 <br /> | ||
| 틀린 예) 122 | ||
| </p> | ||
| <form> | ||
| <input type="text" id="user-input" /> | ||
| <button id="submit">확인</button> | ||
| </form> | ||
| <h3>📄 결과</h3> | ||
| <div id="result">1볼 1스트라이크</div> | ||
| <button id="game-restart-button">재시작</button> | ||
| </div> | ||
| <script src="https://cdn.jsdelivr.net/npm/@woowacourse/mission-utils@1.0.1/dist/mission-utils.min.js"></script> | ||
| <script type="module" src="src/index.js"></script> | ||
| </body> | ||
|
|
||
| <body> | ||
| <div id="app"> | ||
| <h1>⚾ 숫자 야구 게임</h1> | ||
| <p> | ||
| <strong>1~9까지의 수</strong>를 중복없이 | ||
| <strong>3개</strong> 입력해주세요. <br /> | ||
| 올바른 예) 139 <br /> | ||
| 틀린 예) 122 | ||
| </p> | ||
| <form> | ||
| <input type="text" id="user-input" /> | ||
| <button id="submit">확인</button> | ||
| </form> | ||
| <h3>📄 결과</h3> | ||
| <div id="result"></div> | ||
| <button id="game-restart-button" hidden>재시작</button> | ||
| </div> | ||
| <script src="https://cdn.jsdelivr.net/npm/@woowacourse/mission-utils@1.0.1/dist/mission-utils.min.js"></script> | ||
| <script type="module" src="src/Controller.js"></script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[제안]
저는
hidden말고style="display: none"으로 재시작 버튼 숨김 처리를 했는데 두 가지 방식의 차이점에 대해서 같이 알아볼까요?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
좋은 공부가 될 것 같습니다. 관련 내용은 마찬가지로 레포 README에 정리해두었습니다.