mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-12-17 08:00:13 +01:00
Started logic for spellslinger, including storm, magecraft, and started on cantrips
This commit is contained in:
parent
856ba0f572
commit
1819104253
4 changed files with 985 additions and 487 deletions
19
utility.py
Normal file
19
utility.py
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue