예제 #1
0
def Turn_on_game():
    # 1. 실행 메시지를 표시 (Turn on game)
    print('= Turn on game =')
    # 2. 사용자에게 무엇을 할 것 인지 물어보기
    #   1. play game
    #   2. buy_item
    #   3. exit
    while True:
        try:
            selected = input('무엇을 실행 하시겠습니까?(1:play_game, 2:buy_item) : ')
            if int(selected) == 1:
                #buy_gmae()
                play_game()
            elif int(selected) == 2:
                buy_item()
            elif int(selected) == 0:
                break
            elif int(selected) == 3:
                send_message()
            else:
                print('invalid input')
        except ValueError:
            print('must input number')

    print('Game Over')
예제 #2
0
파일: lol.py 프로젝트: webhacking/Python
def turn_on():
    print('= Start game =')
    while True:
        choice = input('What would you like to do?\n  1: Go Shop\n  2: Play Game\n  3: Send Message\n  0: Exit\n    Input : ')
        if choice == '0':
            break
        elif choice == '1':
            buy_item()
        elif choice == '2':
            play_game()
        elif choice == '3':
            chat.send_message()
        else:
            print('Choice not exist')
        print('-----------------------')
    print('= End game =')
예제 #3
0
def turn_on():
    print('= Turn on game =')

    while True:
        choice = input('뭐할래?\n 1: 상점가기\n 2: 게임시작하기\n 3 or 4: 메시지 보내기\n 0: 종료\n  입력: ')
        if choice == '1':
            shop.buy_item()
        elif choice == '2':
            play_game()
        elif choice == '3':
            send_message()
        elif choice == '4':
            friend = input('친구명: ')
            message = input('메시지: ')
            send_message2(friend, message)
        elif choice == '0':
            break
        else:
            print('1, 2, 3중 하나를 입력해주세요')
예제 #4
0
def turn_on():
    print('= Turn on game =')

    while True:
        choice = input(
            '뭐할래요\n 1: 상점, 2: 게임하기, 3: 친구에게 메시지 전송, 0: 나가기\n   선택 : ')
        if choice == '0':
            break
        elif choice == '1':
            buy_item()
        elif choice == '2':
            play_game()
        elif choice == '3':
            send_message()
        else:
            print('있는번호로 선택하세요')
        print('--------')

    print('= Turn off game =')
예제 #5
0
def turn_on():
    print('=Turn on game=')

    while True:
        choice = input(
            'What would you like to do?\n  1: Go to Shop, 2: Play Game, 3: Chat 0: Exit\n    Input : '
        )
        if choice == '0':
            break
        elif choice == '1':
            shop.buy_item()
        elif choice == '2':
            game.play_game()
        elif choice == '3':
            chat.send_message()
        else:
            print('Choice not exist')
        print('----------------------')

    print('=Turn off game=')
예제 #6
0
from functions.game import play_game
from functions.shop import play_game as play_game_shop
from functions import shop
from friends.chat import send_message
import functions

if __name__ == '__main__':
    print(dir(functions))
    # input()을 이용해서 값을 받는다
    #  -> 적절히 1번은 게임실행, 2번은 아이템사기 라고 출력해주기
    # 받은 값이 1인 경우, game.play_game()을 실행
    # 받은 값이 2인 경우, shop.buy_item()을 실행
    # 받은 값이 0인 경우, 프로그램을 종료
    #  0이 아닌 값을 받은 경우 다시 input()을 이용해서 실행할 명령을 받도록 한다 (무한반복, while문을 사용)
    print('= Turn on game =')

    while True:
        val = input('1: 게임실행, 2: 아이템사기, 3: 메세지 보내기, 0: 종료\n입력: ')
        if val == '1':
            play_game()
            play_game_shop()
            shop.play_game()
        elif val == '2':
            shop.buy_item()
        elif val == '3':
            send_message()
        elif val == '0':
            break
        print()
예제 #7
0
파일: lol.py 프로젝트: seokjaehong/Python
if __name__ == '__main__':
    # 1. 실행 메시지를 표시 (Turn on game)
    # 2. 사용자에게 무엇을 할 것인지 물어보기
    #     1. play game
    #     2. buy_item
    #     0. exit
    # 3. 1또는 2를 입력 시 해당 함수 실행 후 다시 사용자에게 무엇을 할 지 물어보기
    # 4. 0을 입력하면 물어보는 반복문을 탈출하고 게임종료 메시지 표시 (Game over)
    print('= Turn on game =')

    while True:
        print(CHOICE)
        choice = input('무엇을 하실래요: ')

        if choice == '1':
            play_game()
            print(f'msg: {PLAY_MESSAGE}')
        elif choice == '2':
            buy_item()
        elif choice == '3':
            send_message()
        elif choice == '0':
            break
        else:
            print('가능한 명령의 번호를 입력해주세요')
        print('')
    print('= Game over =')

#print(f'lol.py의 module name: {__name__}')