Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add selector for languages #74

Open
miron opened this issue Mar 8, 2023 · 0 comments
Open

add selector for languages #74

miron opened this issue Mar 8, 2023 · 0 comments

Comments

@miron
Copy link
Owner

miron commented Mar 8, 2023

languages for cultural region are not rolled but selected, add selector i.e.:

# iterate over the tuple and print each element with its index
for i, lang in enumerate(languages):
    print(i + 1, lang)

# get the player's choice as an integer
choice = int(input("Enter a number: "))

# check if the choice is valid
if 1 <= choice <= len(languages):
    # get the selected string from the tuple
    selected = languages[choice - 1]
    # print it
    print("You chose:", selected)
else:
    # print an error message
    print("Invalid choice.")

Can be done inside the Lifepath class with new method, and initialized in Character with the rolled cultural region as key.
Player gets also 4 points for the language skill in the beginning for the chosen language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant