Skip to content

Commit 0ad0800

Browse files
committed
[swthewhite-lab#1] Add ability to generate 3 different random numbers from 1 to 9
1 parent 9657056 commit 0ad0800

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

.github/workflows/codecov.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Run tests and upload coverage
2+
on:
3+
push
4+
jobs:
5+
test:
6+
name: Run tests and collect coverage
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
- name: Install dependencies
16+
run: pip install pytest pytest-cov
17+
- name: Run tests
18+
run: pytest --cov=. --cov-report=xml --cov-branch
19+
- name: Upload results to Codecov
20+
uses: codecov/codecov-action@v5
21+
with:
22+
token: ${{ secrets.CODECOV_TOKEN }}
23+
slug: swthewhite/python-baseball

docs/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## 기능 추가
2+
1. 1에서 9까지 서로 다른 임의의 수 3개 생성 기능 추가 (2025/02/04)

src/baseball/main.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
1+
import random
2+
3+
def make_computer_num():
4+
computer = random.sample(range(1, 9), 3)
5+
return computer
6+
17
def main():
28
"""
39
프로그램의 진입점 함수.
410
여기에서 전체 프로그램 로직을 시작합니다.
511
"""
612
# 프로그램의 메인 로직을 여기에 구현
13+
print("숫자 야구 게임을 시작합니다.")
14+
computer = make_computer_num()
15+
print(computer)
716

817
if __name__ == "__main__":
918
# 프로그램이 직접 실행될 때만 main() 함수를 호출
1019
main()
20+
21+

0 commit comments

Comments
 (0)