Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
re-format solution in Creative category for Hacker Language by suic
from re import sub
class HackerLanguage:
def __init__(self):
self._message = ""
def write(self, text):
self._message += text
def delete(self, amount):
self._message = self._message[:-amount]
def send(self):
return "".join((c.isalpha() or c == " ") and "{:0<7b}".format(ord(c)) or c for c in self._message)
def read(self, message):
return sub('1[01]{6}', lambda m: m.group(0) == '1000000' and ' ' or chr(int(m.group(0),2)), message)
July 20, 2018
Comments: