This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def read_int(stream, size=1): | |
return int.from_bytes(stream.read(size), byteorder='little') | |
class Node: | |
def __init__(self, stream): | |
self.material = read_int(stream) | |
self.distance = read_int(stream) | |
self.child = read_int(stream, 2) |