Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 618 Bytes

README.md

File metadata and controls

23 lines (18 loc) · 618 Bytes

replay-codecs

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.

Requirements

  • numpy

Usage

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']