Esempio n. 1
0
def get_input_data(source="input"):
    if source == "test":
        #part 1: in this example, the number of bag colors that can eventually contain at least one shiny gold bag is 4.
        # return ["light red bags contain 1 bright white bag, 2 muted yellow bags.",
        # 		"dark orange bags contain 3 bright white bags, 4 muted yellow bags.",
        # 		"bright white bags contain 1 shiny gold bag.",
        # 		"muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.",
        # 		"shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.",
        # 		"dark olive bags contain 3 faded blue bags, 4 dotted black bags.",
        # 		"vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.",
        # 		"faded blue bags contain no other bags.",
        # 		"dotted black bags contain no other bags."]

        #part 2: So, a single shiny gold bag must contain 1 dark olive bag (and the 7 bags within it) plus 2 vibrant plum bags (and the 11 bags within each of those): 1 + 1*7 + 2 + 2*11 = 32 bags!
        return [
            "shiny gold bags contain 2 dark red bags.",
            "dark red bags contain 2 dark orange bags.",
            "dark orange bags contain 2 dark yellow bags.",
            "dark yellow bags contain 2 dark green bags.",
            "dark green bags contain 2 dark blue bags.",
            "dark blue bags contain 2 dark violet bags.",
            "dark violet bags contain no other bags."
        ]
    else:
        return read_csv.file_read_lines("input.csv")
Esempio n. 2
0
def get_input_data(source="input"):
    if source == "test":
        return [
            "35", "20", "15", "25", "47", "40", "62", "55", "65", "95", "102",
            "117", "150", "182", "127", "219", "299", "277", "309", "576"
        ]
    else:
        return read_csv.file_read_lines("input.csv")
Esempio n. 3
0
def get_input_data(source="input"):
    if source == "test":
        return [
            "BBFFFFBRRR", "BBFFFFFRRR", "FBFBBFFRLR", "BFFFBBFRRR",
            "FFFBBBFRRR", "BBFFBBFRLL"
        ]
    else:
        return read_csv.file_read_lines("input.csv")
Esempio n. 4
0
def get_input_data(source="input"):
    if source == "test":
        return [
            "nop +0", "acc +1", "jmp +4", "acc +3", "jmp -3", "acc -99",
            "acc +1", "jmp -4", "acc +6"
        ]
    else:
        return read_csv.file_read_lines("input.csv")
Esempio n. 5
0
def get_pattern():
	input_file = read_csv.file_read_lines("input.csv")
	travel_path = []

	#extend base pattern
	for row in input_file:
		travel_path.append(''.join([row for s in range(len(input_file))]))

	return travel_path
Esempio n. 6
0
def get_input_data(source="input"):
	if source == "test":
		return ["ecl:gry pid:860033327 eyr:2020 hcl:#fffffd",
				"byr:1937 iyr:2017 cid:147 hgt:183cm",
				"",
				"iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884",
				"hcl:#cfa07d byr:1929",
				"",
				"hcl:#ae17e1 iyr:2013",
				"eyr:2024",
				"ecl:brn pid:760753108 byr:1931",
				"hgt:179cm",
				"",
				"hcl:#cfa07d eyr:2025 pid:166559648",
				"iyr:2011 ecl:brn hgt:59in"]
	elif source == "test2":
		return ["ecl:gry pid:860033327 eyr:2020 hcl:#fffffd",
				"byr:1937 iyr:2017 cid:147 hgt:183cm",
				"",
				"iyr:2013 ecl:amb cid:350 eyr:2023 pid:028048884",
				"hcl:#cfa07d byr:1929",
				"",
				"hcl:#ae17e1 iyr:2013",
				"eyr:2024",
				"ecl:brn pid:760753108 byr:1931",
				"hgt:179cm",
				"",
				"hcl:#cfa07d eyr:2025 pid:166559648",
				"iyr:2011 ecl:brn hgt:59in",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:grn byr:2003 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:grn byr:2002 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:60in hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:190cm hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:190in hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:190 hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#123abc ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#123abz ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:123abc ecl:grn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:brn byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:wat byr:1944 eyr:2021 pid:093154719",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:000000001",
				"",
				"iyr:2010 hgt:158cm hcl:#b6652a ecl:grn byr:1944 eyr:2021 pid:0123456789"]
	else:
		return read_csv.file_read_lines("input.csv")
Esempio n. 7
0
def get_input_data(source="input"):
    if source == "test":
        #part 1: in this example, the sum of these counts is 3 + 3 + 3 + 1 + 1 = 11.
        #part 2 concnesus: the sum of these counts is 3 + 0 + 1 + 1 + 1 = 6.
        return [
            "abc", "", "a", "b", "c", "", "ab", "ac", "", "a", "a", "a", "a",
            "", "b", ""
        ]
    else:
        return read_csv.file_read_lines("input.csv")
Esempio n. 8
0
def get_input_data(source="input"):
	if source == "test":
		return [
			"L.LL.LL.LL",
			"LLLLLLL.LL",
			"L.L.L..L..",
			"LLLL.LL.LL",
			"L.LL.LL.LL",
			"L.LLLLL.LL",
			"..L.L.....",
			"LLLLLLLLLL",
			"L.LLLLLL.L",
			"L.LLLLL.LL"
		]
	else:
		return read_csv.file_read_lines("input.csv")
Esempio n. 9
0
def get_input_data(source="input"):
	if source == "test":
		return []
	else:
		return read_csv.file_read_lines("input.csv")
Esempio n. 10
0
def get_input_data(source="input"):
    if source == "test":
        return ["16", "10", "15", "5", "1", "11", "7", "19", "6", "12", "4"]
    else:
        return read_csv.file_read_lines("input.csv")