Baseball game1 Mini -Project #1-1 3자리 숫자 야구 게임 with openai(좌절) chatgpt있어서 한번 해봤는데 좌절 초보인 나하고 비교가 안됨 https://chat.openai.com/chat import random def baseball_game(): target = random.sample(range(0, 10), 3) tries = 0 while True: tries += 1 guess = list(map(int, input("Enter your guess (3 digits): ").strip())) if len(guess) != 3: print("Invalid input. Try again.") continue strikes = 0 balls = 0 for i in range(3): if guess[i] == target[i]: strikes += 1 elif gues.. 2023. 1. 31. 이전 1 다음