Advent of Code 2022 Day 17

Author

Nathan Moore

— Day 17: Pyroclastic Flow —

Some rocks are falling down in the cave and are getting pushed around by jets of hot gas.

How many units tall will the tower of rocks be after 2022 rocks have stopped falling?

with open('data-2022-17.txt', 'r') as f:
    inp = f.read().splitlines()

len(inp[0])

gas = inp[0] * 3

Tetris, so. if we get to the end of the input we loop back to the beginning but we’re probably OK, maybe use it three times? 2022 rocks, each moving down three blocks, but maybe more than that if there are gaps.

rocks = '''
####

.#.
###
.#.

..#
..#
###

#
#
#
#

##
##
'''

Loop the rocks

# looper for gas
g = 0

# looper for rocks
r = 0

for i in range(2022): 
    # rock appears
    pass
    # do a loop for rock fall until it stops
    
        # gas moves first
        
        # move down one space, if it can

Paste part two here