Skip to content

baseball_game main 함수에 관한 질문 #38

@54162476

Description

@54162476
def main():
    print("Play Baseball")
    random_number = str(get_not_duplicated_three_digit_number())
    print("Random Number is : ", random_number)
    user_input = input("Input guess number : ")
    while True :
        if is_validated_number(user_input):
            strike , ball = get_strikes_or_ball(user_input , random_number)
            if strike == 3 :
                while True :
                    strike , ball = get_strikes_or_ball(user_input , random_number)
                    print("Strikes : ", strike, "Balls : ", ball)
                    one_more_input = input("You win, one more(Y/N)?")
                    if is_yes(one_more_input):
                        random_number = str(get_not_duplicated_three_digit_number())
                        print("Random Number is : ", random_number)
                        user_input = input("Input guess number : ")
                        break
                    elif is_no(one_more_input):
                        print("Thank you for using this program")
                        print("End of the Game")
                        break
                    else :
                        print("Wrong Input, Input again")                      
                                            
            else :
                strike , ball = get_strikes_or_ball(user_input , random_number)
                print("Strikes : ", strike, "Balls : ", ball)
                user_input = input("Input guess number : ")
                continue
        else :
            print("Wrong Input, Input again") 
            user_input = input("Input guess number : ")

교수님 다 되는데 n이나 no를 입력했을 때 게임이 끝나는 걸 해결을 못하겠습니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions