This is a Python package for encoding and decoding the replay data of HATETRIS. All codes are based on the original HATETRIS and base2048 codecs.
- numpy
from replay_codecs.codec import encode, decode
# encode
# input: list of keyboard events
# output: string of hexadecimal
print(encode(['D', 'D', 'D', 'R', 'U', 'D'])) #'ਹԇ'
# decode
# input: string of hexadecimal
# output: list of keyboard events
print(decode('ਹԇ')) #['D', 'D', 'D', 'R', 'U', 'D']