mirror of
https://github.com/paradizelost/AdventOfCode2020.git
synced 2024-11-25 02:44:45 -06:00
342 lines
11 KiB
PowerShell
342 lines
11 KiB
PowerShell
$map = @("...#.....#.......##......#.....",
|
|
"...#..................#........",
|
|
"....##....#.......#............",
|
|
".........#.......#.......#.....",
|
|
"..#..............#.........#..#",
|
|
".....#.........#....#....#....#",
|
|
"....##..........#.#.##.........",
|
|
"...#....##...#...#...#.#..#....",
|
|
"...#.......###..........#......",
|
|
".........#.....#....#...#.#....",
|
|
".#...###..#..##..#.........###.",
|
|
"#.#...#..........###...#....#..",
|
|
"#....#.#..#..........#.......#.",
|
|
".#..#........##.#..............",
|
|
"............#..#.#............#",
|
|
".............#..........#......",
|
|
"...#.......#...............#...",
|
|
".#...#..#..#............#..#...",
|
|
"....##.##..................#.##",
|
|
"#......#...#..##....#.....#...#",
|
|
"#..#..........##....#...###....",
|
|
"##......#.##.#......#..#......#",
|
|
"....#...#.......##.##...#.#..#.",
|
|
"##.#...#....#...#...#........#.",
|
|
"........#..#.....#....#.......#",
|
|
".#......#......#..............#",
|
|
".#.....#..#..#..#..#..#....#..#",
|
|
".......#.....#.................",
|
|
".#......#...#..#..#...#...#....",
|
|
".........#..#..#.........#.....",
|
|
".....#.........#.#..........#..",
|
|
"#......#....#....##....#.#.#...",
|
|
"................##.#...........",
|
|
".....##.....#............#.#...",
|
|
"...........#...#.#..##...#.....",
|
|
".......#....##.......#..#....#.",
|
|
".##......##....#....####.##..#.",
|
|
".....#.##.....#...#....##......",
|
|
".............#....#......#....#",
|
|
"#.#.#.###........#.#....#.#....",
|
|
".##...........#................",
|
|
"#..#..#...##..##.##...#..#.#...",
|
|
"..#......##..#.#......#..#.#.#.",
|
|
".....#..............#......#...",
|
|
"#.#..##.##...#............##...",
|
|
".#......#.............#........",
|
|
"........##....#......#..#......",
|
|
"##.........##....#..........#..",
|
|
"..#..#....#.........##....#..#.",
|
|
"........#..#..#........#...#...",
|
|
"#.........#......##.#...#.##...",
|
|
".##.............#..###....#.##.",
|
|
".##.#....#.......#.............",
|
|
"#..##.#.........#..##.#......##",
|
|
"....#..#.......................",
|
|
".#.#.........#...............#.",
|
|
"....#......#.#..##..#...#.#..#.",
|
|
"#....##...##..#.......##.....##",
|
|
"....##...##...#....#.....#..#..",
|
|
".#......#.#.#.#......##..#..#..",
|
|
".....##..#..#.....#.....#...##.",
|
|
"....###................#..#.#..",
|
|
".....#..#..#.#..........#..#...",
|
|
"...#.....#............#........",
|
|
"#.............#...#..#.....#..#",
|
|
"#........#.....#.#..#......#...",
|
|
"...#.##.....#.#..#.........#..#",
|
|
".......##...#..#.#....##.......",
|
|
"..................#..##..#.#.#.",
|
|
"..#......#..#..#.....#...#.#...",
|
|
".#.......#.....#.#....#.#......",
|
|
"##..#.#....#.###..#...#.......#",
|
|
".......................#.......",
|
|
"..###..........#..##.##.#...##.",
|
|
".....#...#....###.........#..#.",
|
|
"..#.....#....###...............",
|
|
"....#.......#........#....#..#.",
|
|
"......#................#.#...##",
|
|
"#.....#.......#..#..........##.",
|
|
"#.#....##.........#.....#.#....",
|
|
"#.#.#...#............####.##..#",
|
|
".....#....####........#...#..#.",
|
|
"....##........#.#..............",
|
|
".#......#..#..##......#....#.##",
|
|
"..#....#.#........#..#....#....",
|
|
".#...#.##...#.#.....#.....#...#",
|
|
"..........#................###.",
|
|
".....#..........##..#..........",
|
|
".....#..................#...#..",
|
|
"#......##....#.#...#..#.......#",
|
|
"..#......##....#......#.#...#..",
|
|
"###.#..###.#.#..#...#....#.....",
|
|
"#.....#.#...#.##...#........#..",
|
|
"#..........................#...",
|
|
".#.#.....#.#.#.......##.#.#....",
|
|
".#....#..##......#....#........",
|
|
".#.......#.##......#.#..#......",
|
|
"............#.....#....##.##...",
|
|
"....##........##......#........",
|
|
"....#......##....##.....#......",
|
|
"..#.#.....#......#...#.#.......",
|
|
".###.........#...#........#....",
|
|
"......#.#...##.....##..##..#...",
|
|
"...#...#.#......#..##..#.......",
|
|
".##....#.#........#.#..........",
|
|
"#....#.#......#......#.#.#.....",
|
|
"#.....#.....#................##",
|
|
"...........#....#...#...#......",
|
|
"..........##..##..#...##.......",
|
|
".##......#.......#..#.#..##....",
|
|
"..........##....#....#..#.#....",
|
|
"...............#......#.....##.",
|
|
".#...#....................#..#.",
|
|
".............###...............",
|
|
".####..............#...#.......",
|
|
"....#...#.#...#...#....#.......",
|
|
".......#.#.....................",
|
|
"...............................",
|
|
"#..#.........##.......#.#.#....",
|
|
"....##...#...........#......#..",
|
|
"........##...#......#..........",
|
|
"....#.#.....#..#......#........",
|
|
"#..#................#..#.##....",
|
|
".#........#.......#.........##.",
|
|
"#...........#...#...#......#.#.",
|
|
"..#.#.#..........##.##...#...#.",
|
|
"..#...#.##...#.#...........#...",
|
|
"##...........##...##...##......",
|
|
"....#....##...#......#..#.....#",
|
|
"#..#.#.#..#...#...#....#.......",
|
|
"............#.....#....#....#.#",
|
|
"....##.....#.........#......#..",
|
|
".....##.......#...#...#.###....",
|
|
"...##......##..###.#.#....#....",
|
|
"#.#.#.#..#.#.........#...#...##",
|
|
"..#..........#.................",
|
|
"....##....#....................",
|
|
"###.#...............##...##.#..",
|
|
"....#.......##.#..#.#..........",
|
|
"............##..#.......##.....",
|
|
"#...#.........#..#..#..#...#...",
|
|
"..#......##..#.#...##.#.......#",
|
|
"......#................#...#...",
|
|
"......#..###............#.#....",
|
|
"..#.#...###...#..#...#......##.",
|
|
"...#.##...##............#......",
|
|
"#...##........#.#..#.......#...",
|
|
"#..#.....#..#.##...............",
|
|
"..#.....#.#....#.........#.....",
|
|
".............#....#..#...#.##..",
|
|
"..#.#.....................##.#.",
|
|
"........#.......#..#.#.........",
|
|
"##..............#.....#.......#",
|
|
".#.##...###....#.....#..##.#...",
|
|
"#..#...#..#......#..........###",
|
|
"#...........#..#...#....#....#.",
|
|
"....#..#.......##......#......#",
|
|
"#...#.#...............##...#...",
|
|
"...##.#..##.......##..#........",
|
|
"...........##..........#.......",
|
|
"..#....#..##...#......#.#......",
|
|
".#.#....#.#.#...#.#............",
|
|
".#.#..#...##.......#.#.........",
|
|
"...#...#.............#.######..",
|
|
"##.#........###.......#....#.#.",
|
|
".#....#.....#.#........#......#",
|
|
"..#.#.........#..........##.#..",
|
|
".#....#.#..............#......#",
|
|
".....#..##.........#..##..#....",
|
|
"........#..#....#.......#.....#",
|
|
"#.#.......#.....#.##.#...#....#",
|
|
"...#...##...#....#.....#....#.#",
|
|
"#..##....#..........#..#.......",
|
|
".......#.#.....#...#.#.#.....##",
|
|
"#...#...#..#......##.#..#......",
|
|
"...#.......#....#...........#.#",
|
|
"##.......#####.#.........#..#..",
|
|
"....#.#...................##...",
|
|
"......#..##............#.......",
|
|
"#.........#....#####.#.#..#.#..",
|
|
"..#......#.#.##............#...",
|
|
"..#...#.....#.#....#......#....",
|
|
".#...#....#....#.#.#......#.#..",
|
|
"..#.##.....#..........#...#.#..",
|
|
".......#...#.............#...#.",
|
|
".#.........#.....#.#........##.",
|
|
"#....#..#..........##.......##.",
|
|
"...#....#.#.........#.......###",
|
|
"......#....#.#......#.......#..",
|
|
".....#...#...#.#...##..#.#.....",
|
|
"#.........##..#...##..#.#....#.",
|
|
"...#......#.#......##.....#....",
|
|
".#####.....#.#.#.#...###.##....",
|
|
"..#................#.#...#.#...",
|
|
"#.......##...#.........##..#...",
|
|
"..#.....#....##............#...",
|
|
"#............##...............#",
|
|
"..#..#.................#.......",
|
|
"...............#..#.......##...",
|
|
"..##..#....#...##..........#..#",
|
|
"#...###....##.#.......#.....#..",
|
|
"..........#.........#..#......#",
|
|
"##....#.....#...##.......#.....",
|
|
"..#..#.......#.................",
|
|
"..#..##......#.........#......#",
|
|
"...........##.#..#......#.#..#.",
|
|
"..#...##...##......#...#...#.#.",
|
|
".#..#.....#.........#..........",
|
|
"#..##...#............#..#.#....",
|
|
"..#...#...##.#........#....#.#.",
|
|
"......##..###.#....#........#..",
|
|
".....#..#....##...##..........#",
|
|
"................#.#.#.....#..#.",
|
|
"#.##...#......#.#..#.......###.",
|
|
".......#.#..#..#......#..##..#.",
|
|
".##...#...#....#....#.......#..",
|
|
"......#..#....#.#.###.....#.#.#",
|
|
"#....#.#...#......#.#.....#..#.",
|
|
".......#.#...#.#.#............#",
|
|
"#.....#..#...#.................",
|
|
".....#..........#..#.#..#.#....",
|
|
".........#......#.#.........###",
|
|
"..#.###........#....##.#.......",
|
|
".#.......#.#......#........#..#",
|
|
"............#........#.....#...",
|
|
"......#......#....#.#....#.....",
|
|
".#.......#.....#.##.#..#...#..#",
|
|
"##.....#...#..........##..#...#",
|
|
".#........#....#...#....##.#...",
|
|
"...#.#.......#.#....#.#...#...#",
|
|
"........#.#.....#.##...#.#.#...",
|
|
"...........#....#..#.........#.",
|
|
"......#.#..#..##...#.......#...",
|
|
"...#....#..#..#.##...........##",
|
|
".#..#.#.#......#....##...#.....",
|
|
"......#..#........#...##.......",
|
|
".............#...##.#.....#...#",
|
|
"....#...............##......#.#",
|
|
".#...........#.........###.##.#",
|
|
"....##........##...#.##.....#..",
|
|
"#......##........#...........#.",
|
|
"###.#.................#.....#..",
|
|
".....##..#.........#......##.#.",
|
|
"#.#.......##.#..#...#...#......",
|
|
"...#.#..##.....#....##.....#.#.",
|
|
"...##..#...#........#.#..#..#..",
|
|
"...........#....#...#...##.....",
|
|
"##.......#...#.#.##...##..#.#..",
|
|
"#....#.#..##...................",
|
|
".#...................#.#..#....",
|
|
"#.....#..........#..#...#...#..",
|
|
"...#..#............#.#.........",
|
|
"............#..##.....##......#",
|
|
"#....#.........#.#..#..........",
|
|
"...#.#................#....#.#.",
|
|
"..#..#...#...#.#.#...#.#.#.....",
|
|
"..#.......#.............##..#.#",
|
|
"#........#.#.###.#...#..#.###..",
|
|
".......#......#..#.....####...#",
|
|
"..##....#..#...................",
|
|
"....##.#....#......#.#..#..#..#",
|
|
"#...........##...#.#.##..###...",
|
|
"##.##......#...........#....#..",
|
|
".#....#....#..#..#...##...#....",
|
|
"...##.#.#......#...............",
|
|
".....##.##...#...........#.....",
|
|
"....#...#.#.........##.#....#.#",
|
|
"#..#...........#......#........",
|
|
"..#..#.....#....#.##.......#..#",
|
|
"..#.......##.....##.......#...#",
|
|
".#.##.#..#...............#....#",
|
|
".........#...........#.........",
|
|
"..........##......#.#..........",
|
|
"..#........###....#..#...#...#.",
|
|
"....#.#...#.....#..#....#......",
|
|
"..##...##...#..#..##......##..#",
|
|
"..#..#......#....#....#...#..##",
|
|
"...#...............#..#........",
|
|
"....##..#...#......#........#..",
|
|
"###.....##.......#.............",
|
|
".#.#.##........##..#...#.......",
|
|
".....###............#..#..#....",
|
|
".#....##.#...####........#.....",
|
|
"............#.#.....##....#.#..",
|
|
"....#..........#...#...........",
|
|
"........#.#...#..##...........#",
|
|
"#.......#..#.......###...#....#",
|
|
"#....#..#......#.....#...##.#..",
|
|
"..#.............#.#.###...##..#",
|
|
".#.#....#...#.....#...#.......#",
|
|
".##.#..#.........#..#......#...",
|
|
"#....#...#......#.....#.....#..",
|
|
"...........#....#.......##...#.",
|
|
"#.#..##....#....#.#.......#.#..",
|
|
"..............#.#..##.##.......",
|
|
"....#........#......#....#.#...",
|
|
"......#.....................#..",
|
|
"#..##...##.....#.........#.....",
|
|
"#.....#.....#....#...#.....#...",
|
|
"........###...........#...#....",
|
|
"............#.....#...##....#..",
|
|
".......#.......#...#.#...##....",
|
|
"..#.#..#....#...#...#....#.....",
|
|
"..........#.#....#....###....#.",
|
|
".##...#......###..#............",
|
|
"...#...#........#....#....##...",
|
|
"##.....#.##...#.#...........#.#",
|
|
"..........#.#....#...##.#...#..",
|
|
"..#....#.#...#...#....#.###....",
|
|
"......#.##..#..#.........#.###.",
|
|
"#.#.#.....#.....##.......#.....",
|
|
"...#..#..#....#.#....#....#....",
|
|
"##..#.#................#......#",
|
|
".....#...#..#......#..####.....",
|
|
".....##.....#....####......#...",
|
|
"..........##..###.#....#.....##",
|
|
"###...#.......#......##...#....",
|
|
".......##...#...#..#.##.#....##",
|
|
".....##.....##...##.....#..#..#",
|
|
"......#.#.....#...#....#...#...",
|
|
"..##........#...#..............",
|
|
"..#........#.##.........#...#..",
|
|
"#....#....#................#..."
|
|
)
|
|
$rightby=1
|
|
$pos=0
|
|
$downby=2
|
|
$trees=0
|
|
for($i=0;$i -le $map.count - 1; $i= $i + $downby){
|
|
$line = $map[$i]
|
|
if($pos -gt 30){
|
|
$pos=$pos-31
|
|
}
|
|
write-host $pos
|
|
write-host $line
|
|
if($line[$pos] -eq "#"){
|
|
write-host $line[$pos]
|
|
$trees++
|
|
}
|
|
$pos = $pos + $rightby
|
|
}
|
|
$trees |