2023-02-16 18:50:30 -05:00
|
|
|
"""Default quirk functions that are always included with Pesterchum."""
|
2011-06-07 11:48:35 -04:00
|
|
|
import random
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-02-16 18:50:30 -05:00
|
|
|
def upperrep(text: str):
|
|
|
|
"""Returns 'text' as uppercase."""
|
2011-06-07 11:48:35 -04:00
|
|
|
return text.upper()
|
2022-10-07 16:51:40 -04:00
|
|
|
|
|
|
|
|
2011-06-07 11:48:35 -04:00
|
|
|
upperrep.command = "upper"
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-02-16 18:50:30 -05:00
|
|
|
def lowerrep(text: str):
|
|
|
|
"""Returns 'text' as lowercase."""
|
2011-06-07 11:48:35 -04:00
|
|
|
return text.lower()
|
2022-10-07 16:51:40 -04:00
|
|
|
|
|
|
|
|
2011-06-07 11:48:35 -04:00
|
|
|
lowerrep.command = "lower"
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-02-16 18:50:30 -05:00
|
|
|
def scramblerep(text: str):
|
|
|
|
"""Returns 'text' randomly scrambled."""
|
2011-06-07 11:48:35 -04:00
|
|
|
return "".join(random.sample(text, len(text)))
|
2022-10-07 16:51:40 -04:00
|
|
|
|
|
|
|
|
2011-06-07 11:48:35 -04:00
|
|
|
scramblerep.command = "scramble"
|
|
|
|
|
2022-10-07 16:51:40 -04:00
|
|
|
|
2023-02-16 18:50:30 -05:00
|
|
|
def reverserep(text: str):
|
|
|
|
"""Returns the reverse of 'text'."""
|
2011-06-07 11:48:35 -04:00
|
|
|
return text[::-1]
|
2022-10-07 16:51:40 -04:00
|
|
|
|
|
|
|
|
2011-06-07 11:48:35 -04:00
|
|
|
reverserep.command = "reverse"
|