def main():
    print("********** WELCOME, adventurer!! **********")

    syl_count = input(
        "Forgot my glasses; can't read my attendance sheet..... how many syllables are in your name?"
    )
    character = Lab_05.create_character(int(syl_count))

    print("********** Welcome " + character[0] +
          "! Announce yourself!**********")

    print("Behold! I am the mighty " + character[0] +
          " - scourge of a place with an equally incomprehensible name.\n")
    print("My uproarious abilities:\n")
    print('####################')

    Lab_05.print_character(character)

    print('####################')

    items_list = [
        "Rapier", "Broadsword", "Vorpal sword", "The constrictor", "A newt",
        "giant spoon", "icingdeath", "bag of holding", "boomstick", "stabstick"
    ]

    eq_count = input(
        "********** " + character[0] + ", I have " + str(len(items_list)) +
        " items for you! But, they're secret. How many you would like?**********\n "
    )
    eq_count = int(eq_count) - 0  # enough of these f'ing string errors

    eq_list = []
    if eq_count > len(items_list) or eq_count <= 0:
        Lab_05.choose_inventory(items_list, eq_count)
    elif eq_count > 0:
        character.append(Lab_05.choose_inventory(items_list, eq_count))
        print(
            "********** You are a new person! Behold, world! I give you: **********\n "
        )
        Lab_05.print_character(character)
示例#2
0
    def test_create_character_is_7_elements(self):
        my_char = Lab_05.create_character(5)

        self.assertEqual(len(my_char), 7)
示例#3
0
    def test_attributes_element_1_are_ints(self):
        my_char = Lab_05.create_character(5)

        for i in range(1, len(my_char)):
            self.assertIsInstance(my_char[i][1], int)
示例#4
0
    def test_attributes_element_0_are_strings(self):
        my_char = Lab_05.create_character(5)

        for i in range(1, len(my_char)):
            self.assertIsInstance(my_char[i][0], str)
示例#5
0
    def test_other_elements_are_lists(self):
        my_char = Lab_05.create_character(5)

        for i in range(1, len(my_char)):
            self.assertIsInstance(my_char[i], list)
示例#6
0
    def test_first_element_is_string(self):
        my_char = Lab_05.create_character(5)

        self.assertIsInstance(my_char[0], str)