Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def decodePowers(self, p, dO=""):
- powers = {}
- if len(p) > 0:
- for d, z in enumerate(p.split("|")):
- if len(z) == 0:
- continue
- p = "{0:#b}".format(int(z))[2:]
- for i, c in enumerate(list(p[::-1])):
- if c == "1":
- id_ = i + (d * 32)
- powers[str(id_)] = 1
- if len(dO) > 0:
- for p in dO.split("|"):
- if len(p) == 0:
- continue
- id_, count = p.split("=")
- powers[id_] += int(count)
- return powers
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement