import random

def GuessingGame():
    def get_int(text="a number "):
        global entry
        global lower_limit
        global upper_limit
        flag = False
        while not flag:
            try:
                entry = int(input("Enter " + text + ":: "))
                flag = True
            except ValueError:
                print("Please enter an integer value")
        return entry

    print("1--Easy",
          "2--Moderate",
          "3--Hard",
          "4--Custom",
          sep='\n', end="\n ----------------------------- \n")

    difficulty = int(input("Select a level of difficulty::"))

    if difficulty == 1:
        lower_limit, upper_limit = 1, 100
    elif difficulty == 2:
        lower_limit, upper_limit = 1, 9999
    elif difficulty == 3:
        lower_limit, upper_limit = -1000, 34500
    elif difficulty == 4:
        print("Enter the range of the random number")
        lower_limit = int(input("Lower limit::"))
        upper_limit = int(input("Upper limit::"))

    x = random.randint(lower_limit, upper_limit)

    # print(x)
    print("you have to guess the random number between ", lower_limit, " and ", upper_limit)
    repeat, c, ci, un = True, 0, 0, 0
    u = get_int("your guess here")
    c += 1
    ci += 1

    while repeat:
        if u == x or un == x:
            print("your guess is right !")
            print("you guessed  the no. in ", c, " turns")
            repeat = False
        elif u > x:
            if ci == 1:
                print("Your guess is greater than the number")
            un = get_int("your next guess here")
            c += 1
            ci += 1
            if un > u:
                print("going the wrong way...")
                u = un
            elif u >= un > x:
                print("getting closer!")
                u = un
            elif un < x:
                u = un
                ci **= 0

        elif u < x:
            if ci == 1:
                print("Your guess is smaller than the number")
            un = get_int("your next guess here")
            c += 1
            ci += 1
            if un < u:
                print("going the wrong way...")
                u = un
            elif u <= un < x:
                print("getting closer!")
                u = un
            elif un > x:
                u = un
                ci **= 0

    end = input("Press enter to exit.")

    # print("G",u,un,c,sep='|')

dc1651c48bf82d9b3669e4b2cbaf41ed84cad60c
<mask token>

<mask token>


def GuessingGame():

    def get_int(text='a number '):
        global entry
        global lower_limit
        global upper_limit
        flag = False
        while not flag:
            try:
                entry = int(input('Enter ' + text + ':: '))
                flag = True
            except ValueError:
                print('Please enter an integer value')
        return entry
    print('1--Easy', '2--Moderate', '3--Hard', '4--Custom', sep='\n', end=
        """
 ----------------------------- 
""")
    difficulty = int(input('Select a level of difficulty::'))
    if difficulty == 1:
        lower_limit, upper_limit = 1, 100
    elif difficulty == 2:
        lower_limit, upper_limit = 1, 9999
    elif difficulty == 3:
        lower_limit, upper_limit = -1000, 34500
    elif difficulty == 4:
        print('Enter the range of the random number')
        lower_limit = int(input('Lower limit::'))
        upper_limit = int(input('Upper limit::'))
    x = random.randint(lower_limit, upper_limit)
    print('you have to guess the random number between ', lower_limit,
        ' and ', upper_limit)
    repeat, c, ci, un = True, 0, 0, 0
    u = get_int('your guess here')
    c += 1
    ci += 1
    while repeat:
        if u == x or un == x:
            print('your guess is right !')
            print('you guessed  the no. in ', c, ' turns')
            repeat = False
        elif u > x:
            if ci == 1:
                print('Your guess is greater than the number')
            un = get_int('your next guess here')
            c += 1
            ci += 1
            if un > u:
                print('going the wrong way...')
                u = un
            elif u >= un > x:
                print('getting closer!')
                u = un
            elif un < x:
                u = un
                ci **= 0
        elif u < x:
            if ci == 1:
                print('Your guess is smaller than the number')
            un = get_int('your next guess here')
            c += 1
            ci += 1
            if un < u:
                print('going the wrong way...')
                u = un
            elif u <= un < x:
                print('getting closer!')
                u = un
            elif un > x:
                u = un
                ci **= 0
    end = input('Press enter to exit.')

import random


def GuessingGame():

    def get_int(text='a number '):
        global entry
        global lower_limit
        global upper_limit
        flag = False
        while not flag:
            try:
                entry = int(input('Enter ' + text + ':: '))
                flag = True
            except ValueError:
                print('Please enter an integer value')
        return entry
    print('1--Easy', '2--Moderate', '3--Hard', '4--Custom', sep='\n', end=
        """
 ----------------------------- 
""")
    difficulty = int(input('Select a level of difficulty::'))
    if difficulty == 1:
        lower_limit, upper_limit = 1, 100
    elif difficulty == 2:
        lower_limit, upper_limit = 1, 9999
    elif difficulty == 3:
        lower_limit, upper_limit = -1000, 34500
    elif difficulty == 4:
        print('Enter the range of the random number')
        lower_limit = int(input('Lower limit::'))
        upper_limit = int(input('Upper limit::'))
    x = random.randint(lower_limit, upper_limit)
    print('you have to guess the random number between ', lower_limit,
        ' and ', upper_limit)
    repeat, c, ci, un = True, 0, 0, 0
    u = get_int('your guess here')
    c += 1
    ci += 1
    while repeat:
        if u == x or un == x:
            print('your guess is right !')
            print('you guessed  the no. in ', c, ' turns')
            repeat = False
        elif u > x:
            if ci == 1:
                print('Your guess is greater than the number')
            un = get_int('your next guess here')
            c += 1
            ci += 1
            if un > u:
                print('going the wrong way...')
                u = un
            elif u >= un > x:
                print('getting closer!')
                u = un
            elif un < x:
                u = un
                ci **= 0
        elif u < x:
            if ci == 1:
                print('Your guess is smaller than the number')
            un = get_int('your next guess here')
            c += 1
            ci += 1
            if un < u:
                print('going the wrong way...')
                u = un
            elif u <= un < x:
                print('getting closer!')
                u = un
            elif un > x:
                u = un
                ci **= 0
    end = input('Press enter to exit.')

import random

def GuessingGame():
    def get_int(text="a number "):
        global entry
        global lower_limit
        global upper_limit
        flag = False
        while not flag:
            try:
                entry = int(input("Enter " + text + ":: "))
                flag = True
            except ValueError:
                print("Please enter an integer value")
        return entry

    print("1--Easy",
          "2--Moderate",
          "3--Hard",
          "4--Custom",
          sep='\n', end="\n ----------------------------- \n")

    difficulty = int(input("Select a level of difficulty::"))

    if difficulty == 1:
        lower_limit, upper_limit = 1, 100
    elif difficulty == 2:
        lower_limit, upper_limit = 1, 9999
    elif difficulty == 3:
        lower_limit, upper_limit = -1000, 34500
    elif difficulty == 4:
        print("Enter the range of the random number")
        lower_limit = int(input("Lower limit::"))
        upper_limit = int(input("Upper limit::"))

    x = random.randint(lower_limit, upper_limit)

    # print(x)
    print("you have to guess the random number between ", lower_limit, " and ", upper_limit)
    repeat, c, ci, un = True, 0, 0, 0
    u = get_int("your guess here")
    c += 1
    ci += 1

    while repeat:
        if u == x or un == x:
            print("your guess is right !")
            print("you guessed  the no. in ", c, " turns")
            repeat = False
        elif u > x:
            if ci == 1:
                print("Your guess is greater than the number")
            un = get_int("your next guess here")
            c += 1
            ci += 1
            if un > u:
                print("going the wrong way...")
                u = un
            elif u >= un > x:
                print("getting closer!")
                u = un
            elif un < x:
                u = un
                ci **= 0

        elif u < x:
            if ci == 1:
                print("Your guess is smaller than the number")
            un = get_int("your next guess here")
            c += 1
            ci += 1
            if un < u:
                print("going the wrong way...")
                u = un
            elif u <= un < x:
                print("getting closer!")
                u = un
            elif un > x:
                u = un
                ci **= 0

    end = input("Press enter to exit.")

    # print("G",u,un,c,sep='|')
