Skip to content

Instantly share code, notes, and snippets.

View eevee's full-sized avatar
🦊

Eevee eevee

🦊
View GitHub Profile
# this could be made to work with surprisingly little effort.
# no, i won't tell you how. please don't do it
class SnarlingBeastEvent(EncounterEvent):
language = 'english'
title = "a snarling beast"
text = "a snarling beast leaps out of the underbrush."
language = 'pig latin'
title = "anway arlingsnay eastbay"
text = "anway arlingsnay eastbay eapslay outway ofway ethay underbrushway."
def find_last(haystack, needle):
last_pos = -1
while True:
next_pos = haystack.find(needle, last_pos + 1)
if next_pos < 0:
return last_pos
last_pos = next_pos