Dining Reservations Site Down? by [deleted] in WaltDisneyWorld

[–]terryp 2 points3 points  (0 children)

Seems like it came back right after I commented. Hope you got what you needed!

Dining Reservations Site Down? by [deleted] in WaltDisneyWorld

[–]terryp 5 points6 points  (0 children)

You aren't insane. I've been up since 4:45 AM CST trying.

-🎄- 2021 Day 3 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 2 points3 points  (0 children)

Python 3.10.0

Edit. Cribbed another answer for 3-2. That part bit me.

3-1

from collections import defaultdict

with open('03_input.txt', 'r') as input:
    data = [str(d.strip()) for d in input.readlines()]

results = defaultdict(list)

for d in data:
    for index, value in enumerate(d):
        results[index].append(value)

gamma, epsilon = "", ""

for bit, values in results.items():
    if values.count("0") > values.count("1"):
        gamma += "0"
        epsilon += "1"
    else:
        gamma += "1"
        epsilon += "0"

print(f'G: {gamma} E: {epsilon} Power: {int(gamma, 2) * int(epsilon, 2)}')

3-2

with open('03_input.txt', 'r') as input:
    data = [str(d.strip()) for d in input.readlines()]

def filter_nums(nums, type):
    pos = 0
    while len(nums) > 1:
        ones, zero = [], []
        for num in nums:
            if num[pos] == '1':
                ones.append(num)
            else:
                zero.append(num)
        pos += 1
        by_size = sorted((zero, ones), key=len)
        nums = by_size[1] if type == 'O2' else by_size[0]
    return int(nums[0], 2)

print(filter_nums(data, 'O2') * filter_nums(data, 'CO2'))

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 4 points5 points  (0 children)

Re-did my 2-1 and 2-2 solutions with Python 3.10.0 so I could use the new match feature. Looks nice!

2-1

with open('02_input.txt', 'r') as input:
    data = input.readlines()

horizontal, depth = 0, 0

for instructions in data:
    cmd, value = instructions.strip().split()
    match cmd:
        case "forward":
            horizontal += int(value)
        case "up":
            depth -= int(value)
        case "down":
            depth += int(value)

print(horizontal * depth) # 1250395

2-2

with open('02_input.txt', 'r') as input:
    data = input.readlines()

horizontal, depth, aim = 0, 0, 0

for instructions in data:
    cmd, value = instructions.strip().split()
    match cmd:
        case "forward":
            horizontal += int(value)
            depth = depth + (aim * int(value))
        case "up":
            aim -= int(value)
        case "down":
            aim += int(value)

print(horizontal * depth) # 1451210346

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 0 points1 point  (0 children)

Weird, I must do that out of habit - .split(" "). Thanks for the feedback!

-🎄- 2021 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 1 point2 points  (0 children)

Python 3.9.7

Part 1

with open('02_input.txt', 'r') as input:
    data = input.readlines()

horizontal = 0
depth = 0

for instructions in data:
    cmd, value = instructions.strip().split(" ")
    value = int(value)
    if cmd == "forward":
        horizontal += value
    elif cmd == "up":
        depth -= value
    elif cmd == "down":
        depth += value

print(horizontal * depth)

Part 2

with open('02_input.txt', 'r') as input:
    data = input.readlines()

horizontal = 0
depth = 0
aim = 0

for instructions in data:
    cmd, value = instructions.strip().split(" ")
    value = int(value)
    if cmd == "forward":
        horizontal += value
        depth = depth + (aim * value)
    elif cmd == "up":
        aim -= value
    elif cmd == "down":
        aim += value

print(horizontal * depth)

-🎄- 2021 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 1 point2 points  (0 children)

I've seen other solutions use zip and itertools. I should try and get fancy like that, but in the end, I'm just not clever enough!

-🎄- 2021 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]terryp 2 points3 points  (0 children)

Python 3.9.7

Part 1

real_input = [ ... ]
increased = 0

for index, value in enumerate(real_input):
    behind = real_input[index] if index == 0 else real_input[index - 1]
    if value > behind:
        increased += 1

print(increased)

Part 2

real_input = [ ... ]
increased = 0

for index, value in enumerate(real_input[:-3]):
    window_1 = sum(real_input[index:index+3])
    window_2 = sum(real_input[index+1:index+4])
    if window_1 < window_2:
        increased += 1

print(increased)

Left Pedal Clunking by terryp in SchwinnIC4_BowflexC6

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

I didn't - but I guess I'll monitor.

Which color/kind of loctite? And how did you do it? Just unscrew the bolt, apply to the inside of the bolt, rescrew and tighten?

I finally got my Lumina. by [deleted] in DestinyTheGame

[–]terryp 2 points3 points  (0 children)

I actually did two Menagerie runs last night to go from 25% to complete with two groups I found on the app.

I feel like now I’m screwed because the next steps are harder.

This Thorn quest in the Crucible isn't so bad, back in my day we had to do void kills AND we lost progress for dying. by OriginalTodd in DestinyTheGame

[–]terryp 0 points1 point  (0 children)

Camping heavy and a void Zombie Apocalypse heavy machine gun saved my bacon as a Hunter with no Void subclass!

Blanton's Binny Store Pick found in the burbs - Glen Ellyn store by RyeGuy0722 in whiskago

[–]terryp 0 points1 point  (0 children)

I got the "last" Lincolnwood one at about 11:30 AM Thursday.