-
Notifications
You must be signed in to change notification settings - Fork 0
/
day-3.1.py
15 lines (12 loc) · 11.3 KB
/
day-3.1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
iinput = ["....#..#.......#........#....#.", "..##.#.#.#...................#.", "....#.#.##..#....#......#......", ".........#.#......##.....#.....", "..........#.###.##...##........", "#....#.#.......##.....#..#.....", "#...........#.#...#..#..##.##..", "......##.............#.....#...", "..##..........###..#.#..##.....", "...........#........#......##..", "..##...........##..............", "..#......###.#.....#.#.#.......", "..#..#..#..........#.#....#....", ".#.....##......................", "...#...##..#...#.........#..##.", ".#......#..#..#...#......#.##..", "..##.##.......#..#.....#..#...#", "..............#..#..#...#......", "...#...#....##.....#...#...#...", "......................#...#....", ".......#......#...#..##...#.#..", "##......#..#.....#....#.....#..", "....#.#.##.#.#....#............", "#.....##.............#.........", "..........#...........#.#.....#", "...#...##....#.#........#..#...", "................#..#.##.##....#", "......#...#...##...##....#.....", "##....#..#..#...#..#...........", "#..................#...#.#..#..", "....##....##.#....#..#......#..", ".....#...........#.........##..", "..#..............#.........#..#", "......##....................#..", "..#.....###...####...#...#.##..", "#..#.#......#.....#.......#.#..", "##.#.........######........#...", "..#....###...#.#..............#", ".....#..............#.........#", "....#......#..#.........#...#..", ".....###.....#.###.......###...", "#.#..#.....#....##...#........#", "..##....#..#.........#...#.#...", "..#..##.............#....#.#.#.", "..##.#..#.#.#.........##.......", "#.#..#.........#..............#", "#..#.........###.......#.#..#.#", ".............#...#....#......#.", "..........#.#...##.###.....#.#.", "..#.....#......................", ".......#......###.#.......#....", "....#....#.........#...###.#.#.", ".#.............#............#..", "....#..#.............#.#....#..", "....#.....#...#...##.#.........", "..#...#...#..................#.", "........#....#.....#...........", ".....##.......#...#.#..#..#....", "...#............#..#.#.........", "......................#........", "....#......#.....#.#....#......", ".....#..#.........#.........##.", "...............#.....#....##...", "...#.#.#...#..#...........#....", ".#....###......##...#.#.#.#....", ".....#...#....####....##.......", "..#......#..#.....##.#...#.....", "...#.##..#....#..##.....#......", "..#......#...#...##.....#...#..", "......#.....#........#.........", "..#.#....#..............##....#", "..#...#......##............#...", ".##.#.......#.......#......#..#", "...##.##...#.....#.......#..#..", "......##..#....#.......#.......", ".....#..#..#.#.....#.....#...##", "##.#...#.#.#.....#...#.#.#.##.#", "...................###...#..#..", ".#.....##.#......#........#....", ".##...##.#..........#...#....#.", "......#..............#.#......#", "...#.......#..#...........#....", ".###...#............##..#...##.", "##..#.#.........#............#.", "#...#.#......#.##...........#.#", ".#.#...#........#......##......", "....#...#...#.....#...#....#...", "...##...........##.........#...", ".........#...#..###............", "..#........#...............#...", ".............#....#.#..........", "........#......#.#.......#....#", ".................#....##.#.##..", "..#...##........#..............", "#..#........#...#....#.........", "......#.#.....#.....#..###.#..#", "....#............#...#.#.#.....", "............#..........#...#...", "..........#....##.#.........#..", "..............#...#...#..#.....", "#......#....#..##....#......##.", "...#....#.................#....", ".#.##.............#...#....##..", "....#..#.........#..#....#....#", "..#.....##..#......#.#..#......", "..#..#.....#........#...#..#..#", ".........##.#.##.#.......#....#", "..#.......##.##...#.....#.....#", ".............##...#...........#", "..#......#..#....#...#..#.##...", "....#........#......#.........#", ".......#........#..#.#.#..##..#", "..#......#...........##...#....", ".....#..#.#...#..............##", ".#..#......#......#........#..#", "...##...............#....#.....", ".......#...#.......##..#.......", ".....#....#...#...#..#.....#.#.", "...#.........#.....#...........", "...#.....###....#....#...#...#.", "#..#.....#.........#.........#.", ".................#.#.....#....#", "...........#..........#..#.....", "........#.#....#...#..#.....###", "#............................#.", "..##..#..#...##.........#......", "......##....#.#...#.........#..", "......#..##.#......#..#.....#..", "...#.......##....#.#....#......", ".....#........#...#............", "#.......#...#.........#......#.", "......#......#....#..#.........", "..#.#........#..#......#....#..", ".#..#.#..........##....###.#..#", "...#....#.##..#...#....#.......", "..#.....#......#.###.......#...", "..............................#", ".....#..#...#...........#......", ".##...#....##....#.#.#.#....#.#", ".#...#....#...#........#.......", "....#............#...##..#.....", "....##..#....#....#.....#....##", ".............#..##.#.#.#.......", "#.......#.#.#.......#..#..#....", "#..#...........#.......###..#..", ".#..##.#.....#........#........", "..#.#.......#............#..#..", "...........#..#............##.#", ".....#.......#.....#..#.##.#..#", "......#......##.....##.........", "..##.#..#.#..#..#..............", ".....#.............##...#.#.##.", ".#......##.#..........#........", "..#..#.........#.....#.#.#.....", "..#.....#.......#.....#..#.....", "#.#.#........#.#...#....#..#...", ".#.#.......#............#....#.", "......#..................#....#", ".#...#...#.....#.#..........#..", ".#..##....####...........#.#...", "..##.....#...#.#....#....#.....", "#.....................#....#.#.", "###..###.#.#...........#.....##", "......#......#..........#......", "...#......#.##.....#......###.#", ".............#..#.#...........#", "..#.............#.#..#.....#...", "...#...............#....##...##", "........#.................#....", "#..###.....#.......##.#......##", "....#.#..............#.........", "#..........#.....#..##...#.....", "................#...#..#....#..", "..#...#....##..........#.#.....", "......#........##......#..#...#", "...#....#..#.....#.......#...#.", ".#.....#..#...#..###....#......", "....#.........#....#.#.#.....#.", "#.#....#...#....#.....#..##....", ".......#..#..#..........#...#..", "..#.#..#.....##.#.#............", "..#....#.....#..##..#..#.#..#..", "..#.##.#...........#...#..#....", ".........#........#...#........", "..#.#.#.......##.........#.##..", "#.#..........#.#...#..#......##", ".#..#....................#.#...", ".##......#................#...#", "..##.#######......#....#.......", "....#...##.#....#.#............", ".##....#...##.......#...#..#...", "...........#...#...#...#..#....", "#...#.....#.......#....#.....#.", ".............#.................", "........#.#.......#...#.#.#....", "..............#............#.#.", "......#......##..#.......#....#", "##...#..................#......", ".....#......###.....#.......#.#", ".....#.#............#.#........", "..#.#..#............#....#.#...", "##.#.###.#.#.#..#......#.......", "...##........#..#.....#.#.#..#.", "##......#.##.....####..#.......", "............#...#..#...#..#....", "...#..#................##.#..#.", ".#....#.#...........##.#.#...#.", "####..#...........#.......###..", ".......#.................#.....", ".......#....#.......##....#....", "..#.........#...#....#.........", "..........#..#...#.#...##..#...", "....##..........#.........##...", "#.........##..#.#..#.......#...", ".#...........#....#...#...#.#..", "....#..#.....#...##....#.#....#", ".#....#.....#......#..##.##.#.#", "#......#..#.......##...........", "...#..#...#.#.................#", "......#.......##....##.#......#", "....#....#.#.#.....#....#....#.", "..#..........#.##...##..#......", "...#..#........#....#.#..#....#", "##.......#........#..........#.", ".#........#.......#...#..##...#", "..#..#..##..#...........#...###", "..#......#..........#..##......", ".#.....#..#.#...#...#.........#", "#.#......##....................", "#...#.....##...........#.......", "........#...#....#.......##....", "...#.##...#....#....#..#..#..#.", "...#..#......##....#..#..##....", "#...#..........#.#.............", "##..#........##.....#.........#", ".....#......#.#...###..#.......", "#..##.#..#.###...........##..#.", ".....#....#..........#.......#.", "##.........##.#................", "....#.........#............##..", ".......#........#......#..#..##", ".#...#...##..#....#..#.........", ".............#...#.#........#..", "......#..#...#..#.###..#.......", "........##.#..#.#..#..#........", "#.##..#..#..........#...##..###", ".##...#............#.#...##..#.", "................#....##.#...#..", "#.................#..........#.", "...#..#..#.....................", "..#...##.#.#...................", ".....#...#.......#............#", "..#..#.........#..##.#..#.#...#", ".....#.#.....#.#.......#.....#.", "..................#..#....#.#..", "..#.....###.##.......##....#.#.", "..#......##.......#....##.#....", "....#...................#..##.#", ".......#....#.##.#.......#....#", "..#...#......#..#...###....#.#.", "..#..#.#....#...........#.....#", ".....#..#..#.......#........#..", "......#.##.#......#...........#", "#...#....#.#..##.##..#..##.....", "#...##....#.#...##........#....", "..##............#.#.#..........", "....#.....#.#..#.......#..#....", "#..#.#.....#..#..##...#..##....", "...##........#...........#...#.", ".####......#..##.........#.#...", ".......#.......................", ".................#....#..#.....", ".........##......###...........", ".##......#.#.#....#.#...#..###.", "....#......##.###.#.#..#.......", "..........#.......##......##..#", "...........#.......#..##.......", ".....###..#..............##....", "........##..#.#.#......#....#..", "#....#.........................", "...........#...............##..", "......#.................#......", ".....#...#..##...##...#...#....", "..........#.#...##.####......#.", "..#.#.....##....#...........#..", "..........#....#..#....##...#..", ".#.......#..##...#...#.....#...", "...##....#.#......##...##....#.", "#.......#.......#.##.#...#.#...", "#...#..................#......#", "..#.......#...............#..##", "#.....#..................#....#", ".##.....#.....#......####.....#", "..#........#...#.#........#...#", "..##.....#....#...#...........#", "..#..#.....##..#.##...#........", "..........###..#....##.....#...", "...#...#....#.##.#...#.#.......", "..##......#.......#.......##...", "............#............#.....", ".##....#.........#.............", "....#....#....#........##...#.#", ".......##......................", "..........#.#.................#", "......##.#...#.........#.....#.", "..#...#......#..#.............#", "..........###.#..#.#...#..#..#.", "#..#.#..#....##...#...#.#...#..", ".#........##...#......#.##.....", "...###.#...##..............##..", "#.#.#...#...#..#....#.#..#.....", ".#.#.##..#....#......#.#.......", "...#..#.#....##...........#..#.", ".....##..##......#.#...........", "......#.....#....####....#.....", ".#.#.#...#..#..#...........#...", ".....#......................#..", ".........#.........#.###.##....", ".....#......##..........#......", "..#...........##...........#...", "..............#.........#.....#", "..#....#..#...#...##.#.........", ".#.#.#....#..........#........."]
size = len(iinput[0])
rows = len(iinput)
trees = 0
currentRow = 0
currentCol = 0
while currentRow < rows - 1:
currentCol = (currentCol + 3) % size
currentRow += 1
if iinput[currentRow][currentCol] == "#":
trees += 1
print(trees)