Skip to content

Commit c3648b0

Browse files
committed
Prepare for 2023
1 parent 9397c69 commit c3648b0

35 files changed

+101
-3
lines changed

2022/day1/input 2022/day01/input

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day2/input 2022/day02/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day3/input 2022/day03/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day4/input 2022/day04/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day5/input 2022/day05/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day6/input 2022/day06/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day07/test-input

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
$ cd /
2+
$ ls
3+
dir a
4+
14848514 b.txt
5+
8504156 c.dat
6+
dir d
7+
$ cd a
8+
$ ls
9+
dir e
10+
29116 f
11+
2557 g
12+
62596 h.lst
13+
$ cd e
14+
$ ls
15+
584 i
16+
$ cd ..
17+
$ cd ..
18+
$ cd d
19+
$ ls
20+
4060174 j
21+
8033020 d.log
22+
5626152 d.ext
23+
7214296 k

2022/day07/test.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
with open('test-input') as t:
2+
data = t.read().splitlines()
3+
4+
for command in data:
5+
if command[0] == '$':
6+
print('command')
7+
print(command)

2022/day8/input 2022/day08/input

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day9/input 2022/day09/input

File renamed without changes.
File renamed without changes.
File renamed without changes.

2022/day12/test-input

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Sabqponm
2+
abcryxxl
3+
accszExk
4+
acctuvwj
5+
abdefghi

2022/day12/test.py

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
with open('test-input') as t:
2+
data = t.read().splitlines()
3+
4+
print(data)

2022/day13/test-2.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import json
2+
3+
with open('test-input') as t:
4+
data = json.load(t)
5+
6+
print(data)

2022/day13/test-input

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[1,1,3,1,1]
2+
[1,1,5,1,1]
3+
4+
[[1],[2,3,4]]
5+
[[1],4]
6+
7+
[9]
8+
[[8,7,6]]
9+
10+
[[4,4],4,4]
11+
[[4,4],4,4,4]
12+
13+
[7,7,7,7]
14+
[7,7,7]
15+
16+
[]
17+
[3]
18+
19+
[[[]]]
20+
[[]]
21+
22+
[1,[2,[3,[4,[5,6,7]]]],8,9]
23+
[1,[2,[3,[4,[5,6,0]]]],8,9]

2022/day13/test.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
with open('test-input') as t:
2+
data = t.read().splitlines()
3+
4+
packets = []
5+
for line in data:
6+
if line != '':
7+
packets.append(line[1:-1].split(","))
8+
9+
rights = []
10+
for pair in range(0, len(packets), 2):
11+
for element in range(0, len(data[pair][1:-1])):
12+
print(data[pair][element])
13+
right = False
14+
try:
15+
a, b = int(data[pair][element]), int(data[pair+1][element])
16+
except:
17+
print('a')
18+
a, b = None, None
19+
if type(a) == int and type(b) == int and a < b:
20+
right = True
21+
if right:
22+
rights.append(pair+1)
23+
print(data[pair])
24+
print(data[pair+1])
25+
26+
print(right)
27+
28+
# for pair in range(0, len(data), 3):
29+
# print(data[pair].split(','))

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
Advent of Code
2-
2021
3-
2022
1+
# Advent of Code
2+
- [2021](2021/)
3+
- [2022](2022/)
4+
- [2023](2023/)

0 commit comments

Comments
 (0)