Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"integrationFolder": "test",
"testFiles": "*.spec.js",
"testFiles": "**/*.spec.js",
"screenshotOnRunFailure": false,
"video": false,
"pluginsFile": false,
Expand Down
23 changes: 23 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
1. 컴퓨터의 값 뽑아오기
2. 유저값 받아오기
3. 컴퓨터와 유저의 값 비교하기
4. 결과에 맞게 출력하기
5. 재시작하기

1. 컴퓨터의 값 뽑아오기
1-1.세가지 랜덤값을 받아 저장하는 함수
1-2.저장할 값이 기존의 값과 겹치는지 확인하는 함수

2. 유저값 받아오기
2-1. 유저값을 받아 배열로 저장하는 함수
2-2. 유저값에 겹치는 숫자가 있는지 확인하는 함수
2-3. 각 값을 비교하는 함수

3. 컴퓨터와 유저의 값 비교하기
3-1. 유저와 컴퓨터 값을 비교하는 함수
3-2. 볼이 몇개인지 확인하는 함수
3-3. 스트라이크가 몇개인지 확인하는 함수

4.결과에 맞게 출력하기
4-1. 볼과 스트라이크 갯수에 따라 text만드는 함수
4-2. 만든 텍스트를 결과창에 출력하는 함수
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<head>
<meta charset="UTF-8" />
<title>숫자 야구 게임</title>
<link rel="stylesheet" href="style.css">

</head>

<body>
Expand All @@ -17,14 +19,15 @@ <h1>⚾ 숫자 야구 게임</h1>
</p>
<form>
<input type="text" id="user-input" />
<button id="submit">확인</button>
<button type="button"id="submit">확인</button>
Copy link
Member

@wzrabbit wzrabbit Mar 17, 2026

Choose a reason for hiding this comment

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

숫자야구 게임의 입력창에서 입력을 하고 확인 버튼을 누르면 정상적으로 게임이 진행되지만, Enter 키를 누르면 그대로 브라우저가 새로고침되는 문제가 현재 있어요.

<form><button>, 특히 <button>type에 대해 좀 더 조사해보시면 원인을 유추해보실 수 있을 것 같아요. 고민해보시고 해결이 가능하다면 해결해 보시겠어요?

</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>
<!-- <script type="module" src="./src/index.js"></script> -->
<script type="module" src="./src/app.js"></script>
</body>

</html>
Loading