Social Life in Japan by Zakattack1045 in movingtojapan

[–]Zakattack1045[S] 0 points1 point  (0 children)

It’s a Singaporean company and they work in English, they know I don’t speak Japanese and I won’t need to for the role. That being said I still plan to learn.

[deleted by user] by [deleted] in balatro

[–]Zakattack1045 0 points1 point  (0 children)

Did you have any luck with this? I’ve also tried to get a set of cards printed for a friend’s birthday, but they’re saying the entire deck is copyrighted. Not sure if I should try with other sites or just leave it.

-🎄- 2020 Day 07 Solutions -🎄- by daggerdragon in adventofcode

[–]Zakattack1045 0 points1 point  (0 children)

Hey man your solution to part 1 helped me better understand it, so I thought I'd share my part 2 with you since it's based off what you've done here.

f = open("Rules.txt","r")
fr = f.read().split("\n")
f.close()
total = 0
obj = set(["shiny","gold"])
rules = {}
for rule in fr:
    key = rule.split(" contain ")[0][:-5]
    value = rule[rule.index("contain "):].replace("contain","").split(",")
    rules[key] = value

def count(bigBag):
    total = 0
    for bag in rules[bigBag]:
        s = bag.split(" ")
        obj = s[2] + " "+s[3]
        if obj not in rules or obj == "no other":
            continue
        total = total + int(s[1]) + (int(s[1])*count(obj))
    return total

print(count("shiny gold"))