Started logic for spellslinger, including storm, magecraft, and started on cantrips

This commit is contained in:
mwisnowski 2024-12-12 12:27:29 -08:00
parent 856ba0f572
commit 1819104253
4 changed files with 985 additions and 487 deletions

19
utility.py Normal file
View file

@ -0,0 +1,19 @@
def pluralize(word):
if word.endswith('y'):
return word[:-1] + 'ies'
elif word.endswith(('s', 'sh', 'ch', 'x', 'z')):
return word + 'es'
elif word.endswith(('f')):
return word[:-1] + 'ves'
else:
return word + 's'
def sort_list(list_to_sort):
if isinstance(list_to_sort, list):
print(list_to_sort)
list_to_sort = sorted(list_to_sort)
print(list_to_sort)
return list_to_sort
else:
return list_to_sort