Skip to content

Instantly share code, notes, and snippets.

@Zomatree
Last active December 6, 2019 21:39
Show Gist options
  • Save Zomatree/3f180efee38bb251026942dbfa18fe86 to your computer and use it in GitHub Desktop.
Save Zomatree/3f180efee38bb251026942dbfa18fe86 to your computer and use it in GitHub Desktop.
[(lambda inp: [print("output:", [lambda re: "\n"+"".join([(match.groups()[1] if not match.groups()[1] == "​" else "\n")*int(match.groups()[0]) for match in re.finditer(r"([0-9]+)(.)", input("> "))]),lambda re:"".join(["".join([f"{a.span()[1]-a.span()[0]}{a.groups()[0]}" for a in re.finditer(r"(.)\1*", input("> "), re.DOTALL) if a.groups()[0] != "\n"])+"1​" for _ in range(int(input("how many lines is it?\n> ")))]),lambda _: quit()][inp-1](__import__("re")))])(int(input("1. rle to ascii art\n2. ascii art to rle\n3. quit\n> "))), input()]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment