-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay23.cs
More file actions
68 lines (63 loc) · 950 Bytes
/
Day23.cs
File metadata and controls
68 lines (63 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AdventOfCode2016
{
class Day23 : Day
{
public dynamic Input
{
get
{
return
@"cpy a b
dec b
cpy a d
cpy 0 a
cpy b c
inc a
dec c
jnz c -2
dec d
jnz d -5
dec b
cpy b c
cpy c d
dec d
inc c
jnz d -2
tgl c
cpy -16 c
jnz 1 c
cpy 93 c
jnz 80 d
inc a
inc d
jnz d -2
inc c
jnz c -5";
}
}
public string Part1(dynamic input)
{
return new Day12().Part1("cpy 7 a\n" + input);
}
public string Part2(dynamic input)
{
return new Day12().Part1("cpy 12 a\n" + input);
}
public void Test()
{
Utils.Test(Part1,
@"cpy 2 a
tgl a
tgl a
tgl a
cpy 1 a
dec a
dec a", "3");
}
}
}