diff options
| author | blenovo <bk@gmail.com> | 2025-08-16 00:38:26 +0200 |
|---|---|---|
| committer | blenovo <bk@gmail.com> | 2025-08-16 00:38:26 +0200 |
| commit | f6ff66ea2da1f30303f17a2dac341411fb325881 (patch) | |
| tree | 934b79fc762547e474a5277723c0c5087b56698f /2018/aoc2018-d08-1.py | |
| parent | edf82358166db84f74419f9a83d328390cc6b356 (diff) | |
final puzzle and little cleanup for 2018blen
Diffstat (limited to '2018/aoc2018-d08-1.py')
| -rwxr-xr-x | 2018/aoc2018-d08-1.py | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/2018/aoc2018-d08-1.py b/2018/aoc2018-d08-1.py deleted file mode 100755 index 2d0110d..0000000 --- a/2018/aoc2018-d08-1.py +++ /dev/null @@ -1,31 +0,0 @@ -currentfilename = "input.txt";
-#currentfilename = "testinput.txt"; #example only
-
-f = open(currentfilename, 'r');
-myinput = eval(f.read().replace(" ",","));
-f.close();
-
-#for i in myinput:
-# print(i);
-
-def NodeAnalysis(License, index):
- NumberOfChilds = License[index[0]];
- index[0] += 1;
- NumberofEntries = License[index[0]];
- index[0] += 1;
- #print(index, " - this node has ", NumberOfChilds, " and ", NumberofEntries);
- for child in range(NumberOfChilds):
- NodeAnalysis(License, index);
-
- for entry in range(NumberofEntries):
- index[1] += License[index[0]];
- index[0] += 1;
- #print("\tcurrent index ", index[0]);
-
-
-i = [0,0];
-
-NodeAnalysis(myinput, i);
-print("input length\t", len(myinput));
-print("final index\t", i[0]);
-print("part1 answer\t", i[1]);
|
