You are viewing a single comment's thread from:

RE: Empirical rarity occurrence in basic packs

in CEO Champion's Gate4 years ago (edited)

some several months old python code, how I converted my CEO box data, much easier to type a single number to represent rares
it outputs like "16/3/1/0" if you type "3/1" for example, for each line

"""

packs = """
2
5
1
3/1
6
3/1
4
4/1/1
7/1
4
3
4/1/1
5/1/1
5/0/1
3
""" # Example

for x in packs.splitlines():
    if x == '': continue                            # Skip blank lines
    commons = str(20 - sum(map(int, x.split("/")))) # 20 minus the sum of the other numbers = the commons
    rV = [commons] + x.split("/")                   # Slice '/' as arrays
    while len(rV) != 4:                             # Fill the array with 0's if unspecified
        rV.append("0")
    print("/".join(rV))```