
This account will be deactivated soon, i moved to #Mastodon. New account: @Brotherluii@masto.ai
- Tweets3.5K
- Following1.3K
- Followers777
- Likes48.9K

ALT ############# initial input #...........# ###A#D#C#A### #C#D#B#B# ######### ############# two A move #.A.......A.# 2 + 2 ###.#D#C#.### #C#D#B#B# ######### ############# right B moves #.A.B.....A.# 70 ###.#D#C#.### #C#D#B#.# ######### ############# both D move #.A.B.....A.# 14000 ###.#.#C#D### #C#.#B#D# ######### ############# left B moves #.A.......A.# 30 ###.#.#C#D### #C#B#B#D# ######### ...
![import re import numpy as np data = [[line[:2]] + list(map(int, re.findall(r'[-+]?[\d]+', line))) for line in open('in.txt')] cubes = np.zeros((101, 101, 101), dtype=int) for switch, xmin, xmax, ymin, ymax, zmin, zmax in data: if -50 <= xmin and xmax <= 50 and -50 <= ymin and ymax <= 50 and -50 <= zmin and zmax <= 50: cubes[xmin+50:xmax+51, ymin+50:ymax+51, zmin+50:zmax+51] = int(switch=='on') print...](https://pbs.twimg.com/media/FHOlL-GXsAgK5hw.jpg?name=small&format=webp)
ALT import re import numpy as np data = [[line[:2]] + list(map(int, re.findall(r'[-+]?[\d]+', line))) for line in open('in.txt')] cubes = np.zeros((101, 101, 101), dtype=int) for switch, xmin, xmax, ymin, ymax, zmin, zmax in data: if -50 <= xmin and xmax <= 50 and -50 <= ymin and ymax <= 50 and -50 <= zmin and zmax <= 50: cubes[xmin+50:xmax+51, ymin+50:ymax+51, zmin+50:zmax+51] = int(switch=='on') print...

ALT from itertools import cycle, product from collections import deque, Counter # no input file parsing today dice = cycle(range(1,101)) player1 = deque(range(10, 0, -1)) player1.rotate(1) #Player 1 starting position: 1 player2 = deque(range(10, 0, -1)) player2.rotate(10) #Player 2 starting position: 10 score1, score2, rolled = 0, 0, 0 while True: player1.rotate(sum(next(dice) for _ in range(3))) rolled +...




