Spaces:
Sleeping
Sleeping
File size: 1,018 Bytes
9bd4ce5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | import json
import os
def check():
path = 'data/cards_compiled.json'
if not os.path.exists(path):
print(f"Error: {path} not found")
return
with open(path, 'r', encoding='utf-8') as f:
data = json.load(f)
counts = {2: 0, 3: 0}
cards_with_bit_29 = []
for cid, card in data.items():
if 'abilities' in card:
for ab in card['abilities']:
bc = ab.get('bytecode', [])
for i in range(0, len(bc), 5):
if i + 3 < len(bc):
if bc[i+2] == 536870912:
counts[2] += 1
cards_with_bit_29.append(cid)
if bc[i+3] == 536870912:
counts[3] += 1
print(f"Index 2 (Bit 29): {counts[2]}")
print(f"Index 3 (Bit 61): {counts[3]}")
if cards_with_bit_29:
print(f"Sample cards with Bit 29: {cards_with_bit_29[:10]}")
if __name__ == "__main__":
check()
|