feat: 11-DiceRoller 과제 구현(조인영) - #56
Open
join0life wants to merge 2 commits into
Open
Conversation
SanginJeong
approved these changes
Jul 27, 2026
| dices: number[]; | ||
| }; | ||
|
|
||
| const RANDOM_DICES = ["⚀", "⚁", "⚂", "⚃", "⚄", "⚅"]; |
le2yunji
reviewed
Jul 28, 2026
le2yunji
left a comment
Contributor
There was a problem hiding this comment.
DiceRoller 구현한 사람들 모두 같은 고민을 했네요 ! 🤣
고생하셨습니다 !
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.
📝 과제 요약
💡 설계 및 고민한 부분
DiceController와Dices를 분리하여 입력(Form)과 화면 표시(UI)의 역할을 분리했습니다.📖 학습한 내용 및 어려웠던 점 (선택)
입력값과 실제 렌더링되는 주사위 상태를 분리하는 방향을 생각해내지 못해서 처음에 헤맸습니다. 처음에는 inputCount와 diceCount를 분리하는 방법을 생각했다가, 추후 랜덤한 주사위 값을 렌더링해야 하는 점을 고려하여 상태를 아래 값으로 나눴습니다.
inputCount: 사용자가 입력 중인 값dices: Roll 버튼을 눌렀을 때 생성되는 실제 주사위 배열해당 방식은 Roll 버튼을 눌렀을 때만 새로운 배열을 생성하도록 하여 입력값이 변경될 때마다 화면이 즉시 변경되지 않습니다.
input box의 min/max 속성으로 브라우저 유효성 검사를 구현했습니다. 해당 속성은 폼 제출시만 검사한다면 활용하기 좋지만, 입력 중에도 값을 제한하고 싶다면 JavaScript로 조작해야 한다는 점을 배웠습니다.
❓ 질문 사항 (선택)
📸 스크린샷 (선택)