diff --git a/2015/__pycache__/helpingFunctions.cpython-311.pyc b/2015/__pycache__/helpingFunctions.cpython-311.pyc new file mode 100644 index 0000000..2d867ff Binary files /dev/null and b/2015/__pycache__/helpingFunctions.cpython-311.pyc differ diff --git a/2015/day00.py b/2015/day00.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day00.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day00/input.day00 b/2015/day00/input.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day00/sample.day00 b/2015/day00/sample.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day01.py b/2015/day01.py new file mode 100644 index 0000000..3119a65 --- /dev/null +++ b/2015/day01.py @@ -0,0 +1,57 @@ +# AOC Script Year 2015 Day 01 +# Date : 2023.12.20 +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + for dataRow in data: + for dataElem in dataRow: + if dataElem == '(': gameScoreA +=1 + if dataElem == ')': gameScoreA -=1 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + floor=0 + for dataRow in data: + for dataElem in dataRow: + gameScoreB+=1 + if dataElem == '(': floor +=1 + if dataElem == ')': floor -=1 + if floor==-1: break + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day01/input.day01 b/2015/day01/input.day01 new file mode 100644 index 0000000..71a7803 --- /dev/null +++ b/2015/day01/input.day01 @@ -0,0 +1 @@ +()(((()))(()()()((((()(((())(()(()((((((()(()(((())))((()(((()))((())(()((()()()()(((())(((((((())))()()(()(()(())(((((()()()((())(((((()()))))()(())(((())(())((((((())())))(()())))()))))()())()())((()()((()()()()(()((((((((()()())((()()(((((()(((())((())(()))()((((()((((((((())()((()())(())((()))())((((()())(((((((((((()()(((((()(()))())(((()(()))())((()(()())())())(()(((())(())())()()(()(()((()))((()))))((((()(((()))))((((()(()(()())())()(((()((((())((((()(((()()(())()()()())((()((((((()((()()))()((()))()(()()((())))(((()(((()))((()((()(()))(((()()(()(()()()))))()()(((()(((())())))))((()(((())()(()(())((()())))((((())))(()(()(()())()((()())))(((()((()(())()()((()((())(()()((())(())()))()))((()(())()))())(((((((()(()()(()(())())))))))(()((((((())((((())((())())(()()))))()(())(()())()())((())(()))))(()))(()((()))()(()((((((()()()()((((((((()(()(())((()()(()()))(())()())()((())))()))()())(((()))(())()(())()))()((()((()(()()())(())()()()((())())))((()()(()()((()(())()()())(((()(()()))))(())))(()(()())()))()()))))))()))))((((((())))())))(()(())())(()())))))(()))()))))))()((()))))()))))(()(()((()())())(()()))))(((())()))())())())(((()(()()))(())()(())(())((((((()()))))((()(()))))))(()))())(((()()(()))()())()()()())))))))))))))(())(()))(()))((()(())(()())(())())(()())(())()()(()())))()()()))(())())()))())())(())((())))))))(())))(())))))()))))((())(()(((()))))(()))()((()(())))(()())(((((()))()())()()))))()))))()))())(()(()()()))()))))))((()))))))))))()((()))((()(())((())()()(()()))()(()))))()()(()))()))(((())))(())()((())(())(()())()())())))))))())))()((())))()))(()))()()))(((((((()))())(()()))(()()(()))()(()((()())()))))))(((()()()())))(())()))()())(()()))()()))))))))(())))()))()()))))))()))()())))()(())(())))))()(())()()(()()))))())((()))))()))))(()(((((()))))))))())))())()(())()()))))(())))())()()())()()())()(()))))()))()))))))))())))((()))()))()))())))()())()()())))())))(()((())()((()))())))))())()(())((())))))))))))())()())(())())())(()))(()))()))())(()(())())()())()()(()))))(()(())))))))(())))())(())))))))())()()(())())())))(())))))()))()(()())()(()))())())))))()()(()))()))))())))))))))()))))()))))))())()())()()))))()())))())))))))))))()()))))()()(((()))()()(())()))))((()))))(()))(())())))(())()))))))(()))()))))(())())))))()))(()())))))))))))))())))))))))()((()())(()())))))))((()))))(())(())))()(()())())))())())(()()()())))()))))))())))))())()()())))))))))))()()(()))))()())()))((()())(()))))()(()))))))))))()())())(((())(()))))())()))()))()))))))()))))))(()))))()))))()(())))(())))(()))())()()(()()))()))(()()))))))))()))(()))())(()()(()(()())()()))()))))))))(())))))((()()(()))())())))))()))())(()())()()))())))()(()()()()))((())())))())()(()()))()))))))))(()))(())))()))))(()(()())(()))))()())())()))()()))())))))))))))())()))))))()))))))))())))))()))))())(()())))(())()))())())))))()()(()()())(()())))()()))(((()))(()()()))))()))))()))))((())))()((((((()()))))))())))))))))))(((()))))))))))))(())())))))())(()))))))(()))((()))())))()(()((()))()))()))))))))))())()))()(()()))))())))())(())()(()))()))())(()))()))))(()()))()()(())))))()))(())(()(()()))(()()())))))(((()))))))()))))))))))))(())(()))))()())())()()((()()))())))))(()))))())))))))()()()))))))))())))()(((()()))(())))))(((())())))))((()))()(()))(()))))(()())))(()))())))))()))))(())(())))()((()))(())())))()()))()))))))))()))(()()()(()()()(()))())(())()())(((()))(())))))))))(((()())))()()))))))))()(())(()))()((((())(())(()())))()))(((())()()()))((()))(()))())())))())))(()))())()())())(()(())())()()()(())))())(())))(())))(())()))()))(()((()))))))))())(()))))))())(()()))()()))()(()(()())))()()(()((()((((((()))(())))()()()))())()))((()()(()))())((()(()(()))(()()))))()())))()))()())))))))()()((()())(())))()))(()))(())(()))())(()(())))()()))))))(((()(((()()))()(()(())())((()()))()))()))()))()(()()()(()))((()())()(())))()()))(((())()()())(())()((()()()()(()(())(()()))()(((((()())))((())))))(()()()))))(((()(())))()))((()((()(())()(()((())))((()())()(()))(((()())()()(()))(())(((()((()())()((())()())(((()()))((()((())(()))(()())(()()()))((()))(())(()((()()())((()))(())))(())(())(())))(()())))(((((()(()(((((()())((((()(()())(())(()()(((())((()(((()()(((()()((((((())))())(()((((((()(()))()))()()((()((()))))()(()()(()((()()))))))(((((()(((((())()()()(())())))))))()))((()()(())))(())(()()()())))))(()((((())))))))()()(((()(()(()(()(()())()()()(((((((((()()())()(()))((()()()()()(((((((()())()((())()))((((((()(()(()(()())(((()(((((((()(((())(((((((((())(())())()))((()(()))(((()()())(())(()(()()(((()(())()))())))(())((((((())(()()())()()(((()(((())(()(((())(((((((()(((((((((()))(())(()(()(()))))((()))()(())())())((()(()((()()))((()()((()(())(())(()((())(((())(((()()()((((((()()(())((((())()))))(())((()(()((())))(((((()(()()())())((())())))((())((()((()()((((((())(((()()(()())())(()(()))(()(()))())())()(((((((()(((()(())()()((())((()(()()((()(()()(((((((((((())((())((((((())((()((((()(()((((()(((((((())()((()))))())()((()((((()(()(((()((()())))(())())(((()(((())((((((()(((((((((()()(())))(()(((((()((((()())))((()((()((()(()()(((())((((((((((((()(((())(()(((((()))(()()(()()()()()()((())(((((((())(((((())))))())()(()()(()(()(((()()(((((())(()((()((()(((()()((()((((())()))()((((())(())))()())(((())(())(()()((()(((()()((((((((((()()(()())())(((((((((())((((()))()()((((())(()((((()(((())())(((((((((((()((((())))(())(()(((()(((()((())(((((()((()()(()(()()((((((()((((()((()(()((()(()((((((()))))()()(((((()((()(()(())()))(())(((((((()((((()())(()((()((()(()))())))(())((()))))(((((((()()()())(()))(()()((()())()((()((()()()(()(()()))(()())(())(((((()(((((((((((()((()(((()(((((((()()((((((()(((((()(()((()(((((())((((((()))((((())((()()((())(((())()(((((()()(((((()((()(()(((((((()(((((()((()((()((())(())((())(()))()()))(()()(()(()()(((((((()(((()(((())()(((((()((((((()())((((())()((()((()(()()())(()))((((()()((((((()((()(()(()((((()((()((())((((((()(()(())((((((()((((((((((()((())()))()(()(()(((((()()()))((())))()(()((((((((((((((()(((()((((()((())((()((()(((()()(()(((()((())(()()())))()(()(()(((((()()(()(()((((()(((((())()(()(()))(((((()()(((()()(())((((((((((((((())((())(((((((((((())()()()(())()(()(()(((((((((())(((()))(()()())(()((((()(())(((((()())(())((((((((())()((((()((((((())(()((()(())(((()((((()))(((((((((()()))((((()(())()()()(())(()((())((()()))()(((())(((((())((((((()()))(((((((((()((((((())))(((((((()((()(()(())))())(()(()))()(((((()())(()))()(()(())(((()))))())()())))(((((()))())()((()(()))))((()()()((((((()))()()((((((((())((()(()(((()(()((())((()())(()((((())(()(((()()()(()(()()))())())((((((((((())())((()))()((())(())(())))())()(()()(())))())(()))(((()(()()(((()(((())))()(((()(())()((((((())()))()))()((((((()(()(((((()())))()))))())()()(((()(((((())((()()(()((()((()(()(()(())))(()()()()((()(())(((()((()))((((()))())(())))())(()))()()()())()))(((()()())()((())))(())(()()()()(()())((()(()()((((())))((()((()(())((()(()((())()(()()(((()())()()())((()))((())(((()()(())))()()))(((()((())()(((((()())(())((())()())())((((((()(()(((((()))(()( \ No newline at end of file diff --git a/2015/day01/sample.day01 b/2015/day01/sample.day01 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day02.py b/2015/day02.py new file mode 100644 index 0000000..d96cceb --- /dev/null +++ b/2015/day02.py @@ -0,0 +1,55 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + for dataRow in data: + sides=[int(side) for side in dataRow.split('x')] + sides.sort() + gameScoreA += (2*sides[0]*sides[1])+(2*sides[0]*sides[2])+(2*sides[1]*sides[2])+(sides[0]*sides[1]) + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + for dataRow in data: + sides=[int(side) for side in dataRow.split('x')] + sides.sort() + gameScoreB += (sides[0]*2)+(sides[1]*2) + (sides[0]*sides[1]*sides[2]) + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Year '+ aocYear +' / Day '+aocDay+': Task 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Year '+ aocYear +' / Day '+aocDay+': Task 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day02/input.day02 b/2015/day02/input.day02 new file mode 100644 index 0000000..b52434e --- /dev/null +++ b/2015/day02/input.day02 @@ -0,0 +1,1000 @@ +4x23x21 +22x29x19 +11x4x11 +8x10x5 +24x18x16 +11x25x22 +2x13x20 +24x15x14 +14x22x2 +30x7x3 +30x22x25 +29x9x9 +29x29x26 +14x3x16 +1x10x26 +29x2x30 +30x10x25 +10x26x20 +1x2x18 +25x18x5 +21x3x24 +2x5x7 +22x11x21 +11x8x8 +16x18x2 +13x3x8 +1x16x19 +19x16x12 +21x15x1 +29x9x4 +27x10x8 +2x7x27 +2x20x23 +24x11x5 +2x8x27 +10x28x10 +24x11x10 +19x2x12 +27x5x10 +1x14x25 +5x14x30 +15x26x12 +23x20x22 +5x12x1 +9x26x9 +23x25x5 +28x16x19 +17x23x17 +2x27x20 +18x27x13 +16x7x18 +22x7x29 +17x28x6 +9x22x17 +10x5x6 +14x2x12 +25x5x6 +26x9x10 +19x21x6 +19x4x27 +23x16x14 +21x17x29 +24x18x10 +7x19x6 +14x15x10 +9x10x19 +20x18x4 +11x14x8 +30x15x9 +25x12x24 +3x12x5 +12x21x28 +8x23x10 +18x26x8 +17x1x8 +2x29x15 +3x13x28 +23x20x11 +27x25x6 +19x21x3 +30x22x27 +28x24x4 +26x18x21 +11x7x16 +22x27x6 +27x5x26 +4x10x4 +4x2x27 +2x3x26 +26x29x19 +30x26x24 +8x25x12 +16x17x5 +13x2x3 +1x30x22 +20x9x1 +24x26x19 +26x18x1 +18x29x24 +1x6x9 +20x27x2 +3x22x21 +4x16x8 +29x18x16 +7x16x23 +13x8x14 +19x25x10 +23x29x6 +23x21x1 +22x26x10 +14x4x2 +18x29x17 +9x4x18 +7x22x9 +19x5x26 +27x29x19 +7x13x14 +19x10x1 +6x22x3 +12x21x5 +24x20x12 +28x2x11 +16x18x23 +2x13x25 +11x7x17 +27x21x4 +2x10x25 +22x16x17 +23x22x15 +17x13x13 +23x24x26 +27x18x24 +24x7x28 +30x12x15 +14x28x19 +2x15x29 +12x13x5 +17x22x21 +27x10x27 +17x6x25 +22x2x1 +1x10x9 +9x7x2 +30x28x3 +28x11x10 +8x23x15 +23x4x20 +12x5x4 +13x17x14 +28x11x2 +21x11x29 +10x23x22 +27x23x14 +7x15x23 +20x2x13 +8x21x4 +10x20x11 +23x28x11 +21x22x25 +23x11x17 +2x29x10 +28x16x5 +30x26x10 +17x24x16 +26x27x25 +14x13x25 +22x27x5 +24x15x12 +5x21x25 +4x27x1 +25x4x10 +15x13x1 +21x23x7 +8x3x4 +10x5x7 +9x13x30 +2x2x30 +26x4x29 +5x14x14 +2x27x9 +22x16x1 +4x23x5 +13x7x26 +2x12x10 +12x7x22 +26x30x26 +28x16x28 +15x19x11 +4x18x1 +20x14x24 +6x10x22 +9x20x3 +14x9x27 +26x17x9 +10x30x28 +6x3x29 +4x16x28 +8x24x11 +23x10x1 +11x7x7 +29x6x15 +13x25x12 +29x14x3 +26x22x21 +8x3x11 +27x13x25 +27x6x2 +8x11x7 +25x12x9 +24x30x12 +13x1x30 +25x23x16 +9x13x29 +29x26x16 +11x15x9 +11x23x6 +15x27x28 +27x24x21 +6x24x1 +25x25x5 +11x1x26 +21x4x24 +10x5x12 +4x30x13 +24x22x5 +26x7x21 +23x3x17 +22x18x2 +25x1x14 +23x25x30 +8x7x7 +30x19x8 +17x6x15 +2x11x20 +8x3x22 +23x14x26 +8x22x25 +27x1x2 +10x26x2 +28x30x7 +5x30x7 +27x16x30 +28x29x1 +8x25x18 +20x12x29 +9x19x9 +7x25x15 +25x18x18 +11x8x2 +4x20x6 +18x5x20 +2x3x29 +25x26x22 +18x25x26 +9x12x16 +18x7x27 +17x20x9 +6x29x26 +17x7x19 +21x7x5 +29x15x12 +22x4x1 +11x12x11 +26x30x4 +12x24x13 +13x8x3 +26x25x3 +21x26x10 +14x9x26 +20x1x7 +11x12x3 +12x11x4 +11x15x30 +17x6x25 +20x22x3 +1x16x17 +11x5x20 +12x12x7 +2x14x10 +14x27x3 +14x16x18 +21x28x24 +14x20x1 +29x14x1 +10x10x9 +25x23x4 +17x15x14 +9x20x26 +16x2x17 +13x28x25 +16x1x11 +19x16x8 +20x21x2 +27x9x22 +24x18x3 +23x30x6 +4x18x3 +30x15x8 +27x20x19 +28x29x26 +2x21x18 +1x23x30 +1x9x12 +4x11x30 +1x28x4 +17x10x10 +12x14x6 +8x9x24 +8x3x3 +29x8x20 +26x29x2 +29x25x25 +11x17x23 +6x30x21 +13x18x29 +2x10x8 +29x29x27 +27x15x15 +16x17x30 +3x3x22 +21x12x6 +22x1x5 +30x8x20 +6x28x13 +11x2x23 +14x18x27 +6x26x13 +10x24x24 +4x24x6 +20x8x3 +23x11x5 +29x5x24 +14x15x22 +21x17x13 +10x10x8 +1x11x23 +21x19x24 +19x9x13 +21x26x28 +25x11x28 +2x17x1 +18x9x8 +5x21x6 +12x5x2 +23x8x15 +30x16x24 +7x9x27 +16x30x7 +2x21x28 +5x10x6 +8x7x1 +28x13x5 +11x5x14 +26x22x29 +23x15x13 +14x2x16 +22x21x9 +4x20x3 +18x17x19 +12x7x9 +6x12x25 +3x30x27 +8x19x22 +1x9x27 +23x20x12 +14x7x29 +9x12x12 +30x2x6 +15x7x16 +19x13x18 +11x8x13 +16x5x3 +19x26x24 +26x8x21 +21x20x7 +15x1x25 +29x15x21 +22x17x7 +16x17x10 +6x12x24 +8x13x27 +30x25x14 +25x7x10 +15x2x2 +18x15x19 +18x13x24 +19x30x1 +17x1x3 +26x21x15 +10x10x18 +9x16x6 +29x7x30 +11x10x30 +6x11x2 +7x29x23 +13x2x30 +25x27x13 +5x15x21 +4x8x30 +15x27x11 +27x1x6 +2x24x11 +16x20x19 +25x28x20 +6x8x4 +27x16x11 +1x5x27 +12x19x26 +18x24x14 +4x25x17 +24x24x26 +28x3x18 +8x20x28 +22x7x21 +24x5x28 +23x30x29 +25x16x27 +28x10x30 +9x2x4 +30x2x23 +21x9x23 +27x4x26 +2x23x16 +24x26x30 +26x1x30 +10x4x28 +11x29x12 +28x13x30 +24x10x28 +8x12x12 +19x27x11 +11x28x7 +14x6x3 +6x27x5 +6x17x14 +24x24x17 +18x23x14 +17x5x7 +11x4x23 +5x1x17 +26x15x24 +3x9x24 +5x3x15 +5x20x19 +5x21x2 +13x5x30 +19x6x24 +19x17x6 +23x7x13 +28x23x13 +9x1x6 +15x12x16 +21x19x9 +25x5x5 +9x7x9 +6x5x8 +3x11x18 +23x25x11 +25x4x6 +4x27x1 +4x3x3 +30x11x5 +9x17x12 +15x6x24 +10x22x15 +29x27x9 +20x21x11 +18x10x5 +11x2x2 +9x8x8 +1x26x21 +11x11x16 +2x18x30 +29x27x24 +27x8x18 +19x3x17 +30x21x26 +25x13x25 +20x22x1 +10x1x12 +11x17x15 +29x11x30 +17x30x27 +21x22x17 +13x6x22 +22x16x12 +27x18x19 +4x13x6 +27x29x10 +3x23x10 +26x16x24 +18x26x20 +11x28x16 +21x6x15 +9x26x17 +8x15x8 +3x7x10 +2x28x8 +1x2x24 +7x8x9 +19x4x22 +11x20x9 +12x22x16 +26x8x19 +13x28x24 +4x10x16 +12x8x10 +14x24x24 +19x19x28 +29x1x15 +10x5x14 +20x19x23 +10x7x12 +1x7x13 +5x12x13 +25x21x8 +22x28x8 +7x9x4 +3x20x15 +15x27x19 +18x24x12 +16x10x16 +22x19x8 +15x4x3 +9x30x25 +1x1x6 +24x4x25 +13x18x29 +10x2x8 +21x1x17 +29x14x22 +17x29x11 +10x27x16 +25x16x15 +14x2x17 +12x27x3 +14x17x25 +24x4x1 +18x28x18 +9x14x26 +28x24x17 +1x26x12 +2x18x20 +12x19x22 +19x25x20 +5x17x27 +17x29x16 +29x19x11 +16x2x4 +23x24x1 +19x18x3 +28x14x6 +18x5x23 +9x24x12 +15x4x6 +15x7x24 +22x15x8 +22x1x22 +6x4x22 +26x1x30 +8x21x27 +7x1x11 +9x8x18 +20x27x12 +26x23x20 +26x22x30 +24x3x16 +8x24x28 +13x28x5 +4x29x23 +22x5x8 +20x22x3 +9x9x17 +28x3x30 +10x13x10 +10x25x13 +9x20x3 +1x21x25 +24x21x15 +21x5x14 +13x8x20 +29x17x3 +5x17x28 +16x12x7 +23x1x24 +4x24x29 +23x25x14 +8x27x2 +23x11x13 +13x4x5 +24x1x26 +21x1x23 +10x12x12 +21x29x25 +27x25x30 +24x23x4 +1x30x23 +29x28x14 +4x11x30 +9x25x10 +17x11x6 +14x29x30 +23x5x5 +25x18x21 +8x7x1 +27x11x3 +5x10x8 +11x1x11 +16x17x26 +15x22x19 +16x9x6 +18x13x27 +26x4x22 +1x20x21 +6x14x29 +11x7x6 +1x23x7 +12x19x13 +18x21x25 +15x17x20 +23x8x9 +15x9x26 +9x12x9 +12x13x14 +27x26x7 +11x19x22 +16x12x21 +10x30x28 +21x2x7 +12x9x18 +7x17x14 +13x17x17 +3x21x10 +30x9x15 +2x8x15 +15x12x10 +23x26x9 +29x30x10 +30x22x17 +17x26x30 +27x26x20 +17x28x17 +30x12x16 +7x23x15 +30x15x19 +13x19x10 +22x10x4 +17x23x10 +2x28x18 +27x21x28 +24x26x5 +6x23x25 +17x4x16 +14x1x13 +23x21x11 +14x15x30 +26x13x10 +30x19x25 +26x6x26 +9x16x29 +15x2x24 +13x3x20 +23x12x30 +22x23x23 +8x21x2 +18x28x5 +21x27x14 +29x28x23 +12x30x28 +17x16x3 +5x19x11 +28x22x22 +1x4x28 +10x10x14 +18x15x7 +18x11x1 +12x7x16 +10x22x24 +27x25x6 +19x29x25 +10x1x26 +26x27x30 +4x23x19 +24x19x4 +21x11x14 +4x13x27 +9x1x11 +16x20x8 +4x3x11 +1x16x12 +14x6x30 +8x1x10 +11x18x7 +29x28x30 +4x21x8 +3x21x4 +6x1x5 +26x18x3 +28x27x27 +17x3x12 +6x1x22 +23x12x28 +12x13x2 +11x2x13 +7x1x28 +27x6x25 +14x14x3 +14x11x20 +2x27x7 +22x24x23 +7x15x20 +30x6x17 +20x23x25 +18x16x27 +2x9x6 +9x18x19 +20x11x22 +11x16x19 +14x29x23 +14x9x20 +8x10x12 +18x17x6 +28x7x16 +12x19x28 +5x3x16 +1x25x10 +4x14x10 +9x6x3 +15x27x28 +13x26x14 +21x8x25 +29x10x20 +14x26x30 +25x13x28 +1x15x23 +6x20x21 +18x2x1 +22x25x16 +23x25x17 +2x14x21 +14x25x16 +12x17x6 +19x29x15 +25x9x6 +19x17x13 +24x22x5 +19x4x13 +10x18x6 +6x25x6 +23x24x20 +8x22x13 +25x10x29 +5x12x25 +20x5x11 +7x16x29 +29x24x22 +28x20x1 +10x27x10 +6x9x27 +26x15x30 +26x3x19 +20x11x3 +26x1x29 +6x23x4 +6x13x21 +9x23x25 +15x1x10 +29x12x13 +7x8x24 +29x30x27 +3x29x19 +14x16x17 +4x8x27 +26x17x8 +10x27x17 +11x28x17 +17x16x27 +1x8x22 +6x30x16 +7x30x22 +20x12x3 +18x10x2 +20x21x26 +11x1x17 +9x15x15 +19x14x30 +24x22x20 +11x26x23 +14x3x23 +1x28x29 +29x20x4 +1x4x20 +12x26x8 +14x11x14 +14x19x13 +15x13x24 +16x7x26 +11x20x11 +5x24x26 +24x25x7 +21x3x14 +24x29x20 +7x12x1 +16x17x4 +29x16x21 +28x8x17 +11x30x25 +1x26x23 +25x19x28 +30x24x5 +26x29x15 +4x25x23 +14x25x19 +29x10x7 +29x29x28 +19x13x24 +21x28x5 +8x15x24 +1x10x12 +2x26x6 +14x14x4 +10x16x27 +9x17x25 +25x8x7 +1x9x28 +10x8x17 +4x12x1 +17x26x29 +23x12x26 +2x21x22 +18x23x13 +1x14x5 +25x27x26 +4x30x30 +5x13x2 +17x9x6 +28x18x28 +7x30x2 +28x22x17 +14x15x14 +10x14x19 +6x15x22 +27x4x17 +28x21x6 +19x29x26 +6x17x17 +20x13x16 +25x4x1 +2x9x5 +30x3x1 +24x21x2 +14x19x12 +22x5x23 +14x4x21 +10x2x17 +3x14x10 +17x5x3 +22x17x13 +5x19x3 +29x22x6 +12x28x3 +9x21x25 +10x2x14 +13x26x7 +18x23x2 +9x14x17 +21x3x13 +13x23x9 +1x20x4 +11x4x1 +19x5x30 +9x9x29 +26x29x14 +1x4x10 +7x27x30 +8x3x23 +1x27x27 +7x27x27 +1x26x16 +29x16x14 +18x6x12 +24x24x24 +26x2x19 +15x17x4 +11x7x14 +14x19x10 +9x10x1 +14x17x9 +20x19x13 +25x20x8 +24x20x21 +26x30x2 +24x2x10 +28x4x13 +27x17x11 +15x3x8 +11x29x10 +26x15x16 +4x28x22 +7x5x22 +10x28x9 +6x28x13 +10x5x6 +20x12x6 +25x30x30 +17x16x14 +14x20x3 +16x10x8 +9x28x14 +16x12x12 +11x13x25 +21x16x28 +10x3x18 +5x9x20 +17x23x5 +3x13x16 +29x30x17 +2x2x8 +15x8x30 +20x1x16 +23x10x29 +4x5x4 +6x18x12 +26x10x22 +21x10x17 +26x12x29 +7x20x21 +18x9x15 +10x23x20 +20x1x27 +10x10x3 +25x12x23 +30x11x15 +16x22x3 +22x10x11 +15x10x20 +2x20x17 +20x20x1 +24x16x4 +23x27x7 +7x27x22 +24x16x8 +20x11x25 +30x28x11 +21x6x24 +15x2x9 +16x30x24 +21x27x9 +7x19x8 +24x13x28 +12x26x28 +16x21x11 +25x5x13 +23x3x17 +23x1x17 +4x17x18 +17x13x18 +25x12x19 +17x4x19 +4x21x26 +6x28x1 +23x22x15 +6x23x12 +21x17x9 +30x4x23 +2x19x21 +28x24x7 +19x24x14 +13x20x26 +19x24x29 +8x26x3 +16x12x14 +17x4x21 +8x4x20 +13x27x17 +9x21x1 +29x25x6 +7x9x26 +13x25x5 +6x9x21 +12x10x11 +30x28x21 +15x6x2 +8x18x19 +26x20x24 +26x17x14 +27x8x1 +19x19x18 +25x24x27 +14x29x15 +22x26x1 +14x17x9 +2x6x23 +29x7x5 +14x16x19 +14x21x18 +10x15x23 +21x29x14 +20x29x30 +23x11x5 diff --git a/2015/day02/sample.day02 b/2015/day02/sample.day02 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day03.py b/2015/day03.py new file mode 100644 index 0000000..f786650 --- /dev/null +++ b/2015/day03.py @@ -0,0 +1,81 @@ +# AOC Day Script Day 03 +# Date : 2024.11.09 +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + + +def movePoint(actualPoint,movement): + x0,y0 = actualPoint + x1,y1 = movement + return ((x0+x1,y0+y1)) + +def visitHouses(actualPoint,movements): + visitedHouses=[] + visitedHouses.append(actualPoint) + for move in movements: + if move == '^': actualPoint = movePoint(actualPoint,(0,1)) + elif move == 'v': actualPoint = movePoint(actualPoint,(0,-1)) + elif move == '>': actualPoint = movePoint(actualPoint,(1,0)) + elif move == '<': actualPoint = movePoint(actualPoint,(-1,0)) + visitedHouses.append(actualPoint) + return visitedHouses + +def taskA (data) -> int: + gameScoreA = 0 + for dataRow in data: + visitedHouses=visitHouses((0,0),dataRow) + gameScoreA=len(list(set(visitedHouses))) + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + for dataRow in data: + rowNr=0 + santaMoves=[] + roboMoves=[] + for dataElem in dataRow: + rowNr += 1 + if ( rowNr % 2 == 0 ): + roboMoves.append(dataElem) + else: + santaMoves.append(dataElem) + santaVisited=visitHouses((0,0),santaMoves) + roboVisited=visitHouses((0,0),roboMoves) + visitedHouses = santaVisited+roboVisited + gameScoreB=len(list(set(visitedHouses))) + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day03/input.day03 b/2015/day03/input.day03 new file mode 100644 index 0000000..03504fc --- /dev/null +++ b/2015/day03/input.day03 @@ -0,0 +1 @@ +^><^>>>^<^v<<^<><^<^v>^vv<>v>>^^^v<<<^>^<^v<^>^v><<<^>><>v>v^<<^>^<<^^^>v>>v^^>^>vv>>^>>v^>^v>^<^^v>^>^^v^^>v^^v><^><^<<>v^<^<^vv^>>>v^v^>^<>^v<^^vv^>^<>^^<vv<>^>v<^>^v>v^>^v<>^><>>v^v<><>v^v>>>>v^^>^><^^<^>^v^v<>v<<<^<v^^^<^^^>v<^v>>>>>v<^^^^>v<^<>>>>>>v^vvvv^^^v<^v^>v><^>^v<<>>vv^>v>v^^>vv^<^vvv<>><>><><^^^^<^^^<^v>>v>^v^^^>v^^^v>>^v^^<^>>^>^<>>^^<>>^vv>v^<^>>>><><^^v<><<<<^^<>>^<>vv^<^>v^^><^v>^^>v<>^v^<>^vv^>vvv>v>^>^>>^>><>>>^^^^v^<>v^^>^<>v<^^v><^v><>^^^^^v^v>>^^v><<><^^^^><^>v>><<<^v>v^^>^v^<^^v>v<^<<>>^v<<>v<^v^>v^>^v<<v>v>>v>v^^v>^v^>>>><>^>v>^v^>>>>v^<<<>vvv>><^^>^<><^^<^v^v^<^^>^<^v^<<<^^v^v>>><>^^>vv<<^v^<<<<^^>>>v>v<<<>^^>>>v>^>v>vv<<>^<^>^^<^>^v^<>v^><^^^>vv>><^v<^<<<><<^^<><>v>^>^<>>^^v>vv^<^^v>><^vv^<<<>vv^v<^<>v^^>><>^<^v<<<^<<^>>>^^<^^v>v^vvvv>v<>><^>^<<<v^^^v<>v>^^<v>>v>>v^>^<>v><>>>v^>^v<^<><<^>^^^>^><>^><^<>vv<>>v^v>^>^>^<^><>v<><>>>^^^<^v>>^<>>>vv^>vvvv>>><^>v<>^^^>v>>v^v^>^^<<^>^>>v<<><>v^^>v^><<^v^>^^<v><<<^v^<>^<>^>>^<^^<>^v<>v^>>><>^><>>vv>v^<^^^>v>^^>^v<><>>><>><^<>>v>v^^>^^<^^>^>>v>vv^^v<^<^v>><<^>^v>^^^<<>v^<^^v<<<>^^vv<^>vv>^>^<><<>vv<^>v^vv>^^^v><<^vv>^v<>vv^^<^<>^^v^<^vvv>v^^<>^^>^^>^<><<^v>^><^^vvvv<><>^v<>^><>v>><>vv^<<><<>><>v<^>^v>>^^v><<<>>^<^v^^^<^<><><^><<<<^^<>><><>>v><<vvvv^^vv><<^v^vvv><>v><>v<<<^><^^>v^>^^^v^v>><<>^v<>v^v<<<<^^^v^v<<>>>v>>vv>^^<><^v<>>v^>>>>>^>v^v^<^v^v^vvv>vvv^<vv>>v^^vv<^v>>>>vv<>v<>^^vv^v^>>vvv<<v>v>^><<<^>v^>^v^^^><<><<<^^<^^<>^^v<^v>^v<^>^>><>^v^v<<^>^>v><^>^vv^^^v^v^>^<<>>>>>v^<>^>v^vv^><<>>^^<>v^>^vvv^>v^v><>^><<>v>v<^<^><^^vv<<><>>v>>v>>^v<<>^vv<>^vv>v>v>^>^>>><><<>v^<<^v^^<<<>>vv<^<<>v<^^^<<^v^>^v>^^^v^v>>>v>v^v>^>^vv<^^<^<<v^<><<^vvv^^><>vv^v>v>^><<^^^^vvv^><^v<^>^<>>^>>vv^<>>^v>^>v>^<^<^^^<>>>>>>v>^<>^^v^><>><^v^^><>v^v<^<<<<^>^^>vv>><^v^vvv>v^^><^^<^<>>^^v^vv<>v<^<<v>v<>^v^><>v<^v>><<^<^v^>><^<^><>v>>^vv<^v>^>v<^>>^>>v^>^v<^v^v><<><>^><<<><>^<>^^^^v>^>^vvvvv>v>>v><<<^><<^v><^v>>>>^v<^v<<>>^>^<v>><<^>^>^v><><>^><v^><<^v^<^^><^^v^<<^v^^>>^v^<^>v^^<<^^^<><>^>v^v>v^>^v^vv>^^>>>>^^<^>>>^^v<^^v><<<>^>^^>^>^v<<<<>>^<<>>>v>^^<^v<>v<>v^>v^><^<^^>^^vv><>v>^<<<^><^^<^<^^v<^>v^v^^^><^>v^v>>^^v^>>>>><<>^>v>v<>>>v>^^^^>>v^<<^>>><^v^<<>>v><>^v^^><<>>^>^>vv<^<>^vvv^vv^v>^^<<<<<>^v^>^<>v^^<>v^v^<>vv^<^vv>>><<>v^^^>^>^^>>>vvv>^>v>v>>>^>vv^><>^><>v>^^^><><<<>>v^v<^<>^^<>^^<<><>^v<><>>>^vv<^<<^<^v>v<<<<<^^v<^v<><^>v>^v>>^v^><^^^^v<><><>vv^<>vv<^v<^^><^^v^v^<^^<<>v<>v^v<^>vvv><<^v>>v><>>>v<^>>v>^<>><>^v<^^>^<^v<^<<^^v<>>^>^>^v^^v^v>v>v<>v^>v^^>^^>><<>><<^^>><^v<<><<>>>>>>^^^^^<<>^<<^><<^^vvv<<>vv><<>v>v^v>>>>>^<>><^^^><<<<>>v<^>>>^^vvv>v<>>>>v>>^v^vvv<<>vvv<<^^^<>vv^^v<<>^^^>>^<^v^<^^>v^>>^<<^v<v^>>^>v^><^><>^>>>vv>><^^^>vv<<^^vv><^<>^>^^<^<>>^vv^>>^v><>v^>>><<<^^<^>^>v<^>^<^^<>>><^^<>^v^<<>vvv>v^v<<^^^><<^vv^v>v>v<<^v^<<<>^><>v>^vv^v<>vv^>^^<^>^>v^^v><>>^v<^<><><^vv<><<>v^^>^^<><<>^<^<<<>v>><^<<>^>^v^v<^>>^v<^>v<<>^^^<^v>>>^vvvv<vvvv>v<>v^<><>vvv<>^<<>^>>>>v^<^<><^v>v^>>v><>^><^<<>^>^v^>^v>^<>v^<^^>v>^>>>v^v>>>^<>^<>>>>>v>>vv^v<><<<><><<>>vv<^^v<<>v^v<^v<>>^v>>vvv^^v>>v>^>^>v><^>^^<<>^v<^<<<<^>v<^>>v^<^v>^v<<>^>^vvv<^^vv>^vv>vv<>>v>v>v^<<<<<^^v^>v>^<<>v^<<>>^<^>^^<>>>>^<^v<>v^^>^<^^v<^><>>>^v^vv<^v<^><><>><^^>^<^v^<^<>v<<<^v>v^^^<>v^^v^>><>^^<<^^v^<>^<^vv>>><^v>vv<^v<<>v>v^v>^v<^<>v^vvv>^vv<<<<^>>^^>><^v><<^>v^^<<<<<>^v<<^^>v<<<<^>^>^>>^>>>v^<>^^v>>>^vvv<^v<>>>vv>^^><^v>vv^>>v>v^<>^^>^<<^>^^^>>^vv>^^>vvvv<>>^^^^>>>v>v^^>vv>vv^<<>^><^><<>>^>^><^v^>v^<>^>v^^v^>^^>v<<<<^<<^>>v>v^^^<<>>^^v>v<<<<^^^v>^vv^>><>^v<>>>v>vvv^v^^v^>>vv>^>><>^v><^v^><^^>vv>^<^<^>>v>><><>^>^>v>vv>vv>^^>v>v^>^>^v>^^v>^<^v<>>vvv^^>^>vvv^^v<^<^>vv^^<^^^>v>vv<v<^>^v^<^>v<^>^<>vv^><>>^>>^<^><<>^<^>v>v><>>>^<<^><<^v<>>vv<^>>v>v>>>>^^>v<^v^>><<^<>>v><^><<^>^<<>>^^<><^^v>^^>vv>^v>^^v^<^<<>>v^^^<^><^<<><><<>^v>vvv^vvv^^>>^<^><>^<<<<^^<>>>v^<<^^v>><><v>^vv>vv^><>^><<><^^>^>^<><>><^^<><>^>><^v<<<<>>^v>^^vv^v^<><<vv>>v>>^v^<>>vv^<^>^<<>v<<<^vv<^vv^vv<^v^^^v>>v<^^<^^vvv<^^v<>>>^>v^>^^><>vv>v>v<<<^^v<^vv^v>^^^>>>^^<>^^<^vvv>><><<><^><<>^>^^vv>vv^^<^^<<><><v><<>v>vvv<^^^^<^>>><<<^^^<^>vv^^v>>v<vvv^^v^^<^v<^<>^<^v>>^><><>v>>>^^>>v^>><>v<><>>><>>>>><<^vvv<<><><<>^><><<^^v><<^>v>^>^v>v>>^^<><^>vv<^<^v>v<><^<<^><>^^^^^v>><>^>^vvv>v^vv^v^>v><>v^><>v>^^^^><^v^^^>^^><<^^>v>v<^v^^vv^<<<<^>v>v^v><>^><><>^v^<>^v>^v>v^<><^>>v<<^><^vv^<><^<>><>><<^^^^>v<^<^vv<><^vv><<^<v^>>^v>^>v^^v>vvv<v<>^>>vv^>>><>^v^^<^>v<<^<^^v^^v^<vv^><^v<^>>>vv^^^^v>^><^^^<><<^^>v<><><><>vv^><<^>^><^v<^<^v^v<<<<<<><vv>v<^><<><><<>>v>><^>^v>^v^<>v^^^><^^<<<^vv^vv>^v^vvv^^>v^><^<^<^<>^vv^^^>vv^v>>><<<^<>>v>v<^^<>>><><^v^^<<><<<>^<^^v^>v><^<^>^>>^<>^v><>>^vv^>^^<<<^v<>>^v<>vvv<<^^<<>>>>^^<><>^><>^vv^v<^>^v<>v^vv<><^vvv<><<^>>^^><><>^<>^>v^^v^><>>v>><^v>^v<<<>vvv^<^^v^<>^>>v<>^^><>>^><^^vv>><<>><^><>>^vv>vv^v^^v<<^^v^^vv<<^<<><>^<><^<^<>>^vvv>>^<^vv>^vv^>v>^<><^><^<>v^v^^<^<>^^v>>><^v<>v^v<<^>v><>^^<v^>>v>^<>^>^>^<^>v><<><><><<<>^>><^>>>^v<<<^<<>^><<^>>>>>v<^>v>>v^^>v^^><>v^v^vvvvv>>><<>^<v>^>^vv^^<^>>v>vv^v<^<>^v^<^<<><<<^vvv^>^^<<>>>vv<<^<><^v<^<><<^^>vv^v>v^^^>>>>^>vv<v>>^^v^^><>v<<^><^>^>v^v>><^v^>v<<^<^<^<^<>>v^^>><<<>vv<^^>^vv<<<^^v^^>v<<><^<>^^>^v<>v>><^^^vv^>^><>v^^>^v>^<<^v>^>>>>><^^^<>v>v^^<^v^>>v^<^>v^v>>>>^>>vv<>^<^v>v>v^v>^<>^>v<<>^<>>^<>>^<>v^><<>^v>>^^^^<<^v><>^<^>^^v><^^<^^v>v<<^>^>><<^^^vvv<<^vv<^^>v^^vv^<^^<<^^>>^^<v^>>v^^>v<^>^>vv>><v><^<^vv>^^v>^>v<<^vv><^^^^^^><<^>>>^v<>^^v<<<>><<<>^<<v^>^^^<^>^^^v<<>v^><<^^<<^v<<>^v>>vv>><<^v^^>v^v>^^v<><^^^<^^>v>^<>vvv^v^^^>v^^v<^>^^>>^v<><^><^<<^vv^<><<>v^vv^<<<^^>v<<>>>v<>v<><<^v>^^v>^^>v>^>^>v<>><>^>^>^vvvv<^^^^^v>v>><>^>^><>^^>v^^<<><^><<<<>v>^^>^v<<<>vvv>>v<^v>>v>v^<<<>^>^>^<>v<^^vv><^v<<^vv<^<<^^vv^^>vv<^>v>^^<^>v<<^^<^>^^^v^^>>v^vv^<^v>^<>^<^>>^<^v<>v><^^<><>^>v<^<^vv>><^v>^<>^^>^<><<>^<>><<>vvv^<<^^>>v<^>>vv>^v^^^v<>v<>><>^vv^>vv^ \ No newline at end of file diff --git a/2015/day03/sample.day03 b/2015/day03/sample.day03 new file mode 100644 index 0000000..8f30005 --- /dev/null +++ b/2015/day03/sample.day03 @@ -0,0 +1 @@ +^v^v^v^v^v \ No newline at end of file diff --git a/2015/day04.py b/2015/day04.py new file mode 100644 index 0000000..2f10e3e --- /dev/null +++ b/2015/day04.py @@ -0,0 +1,68 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from hashlib import md5 +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + for inputData in data: + inputValue=0 + while True: + inputValue+=1 + data2Hash = inputData+str(inputValue) + hashValue = md5 (data2Hash.encode()) + hashValue = hashValue.hexdigest()[:5] + if (hashValue == '00000'): + gameScoreA=inputValue + break + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + for inputData in data: + inputValue=0 + while True: + inputValue+=1 + data2Hash = inputData+str(inputValue) + hashValue = md5 (data2Hash.encode()) + hashValue = hashValue.hexdigest()[:6] + if (hashValue == '000000'): + gameScoreB=inputValue + break + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day04/input.day04 b/2015/day04/input.day04 new file mode 100644 index 0000000..fe1c591 --- /dev/null +++ b/2015/day04/input.day04 @@ -0,0 +1 @@ +iwrupvqb \ No newline at end of file diff --git a/2015/day04/sample.day04 b/2015/day04/sample.day04 new file mode 100644 index 0000000..d96dc95 --- /dev/null +++ b/2015/day04/sample.day04 @@ -0,0 +1 @@ +abcdef \ No newline at end of file diff --git a/2015/day05.py b/2015/day05.py new file mode 100644 index 0000000..782ec2b --- /dev/null +++ b/2015/day05.py @@ -0,0 +1,118 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def checkVocals(inputData): + retValue = False + foundVocal=0 + for i in range(0,len(inputData)): + letter = inputData[i].lower() + if letter == 'a' or letter == 'e' or letter == 'i' or letter == 'o' or letter == 'u': + foundVocal+=1 + if foundVocal > 2: + retValue = True + break + return retValue + +def twiceInRow(inputData): + retValue=False + for i in range(0,len(inputData)-1): + if inputData[i] == inputData[i+1]: + retValue = True + break + return retValue + +def notContain(inputData): + retValue=False + for i in range(0,len(inputData)-1): + checkValue = inputData[i].lower()+inputData[i+1].lower() + if checkValue == 'ab' or checkValue == 'cd' or checkValue == 'pq' or checkValue == 'xy': + retValue = True + break + return retValue + +def doubleTwice(inputData): + retValue=False + for i in range(0,len(inputData)-1): + doubleValue = inputData[i].lower()+inputData[i+1].lower() + for j in range(i+2,len(inputData)-1): + twiceValue = inputData[j].lower()+inputData[j+1].lower() + if doubleValue == twiceValue: + retValue = True + break + if retValue == True: + break + return retValue + +def twiceInBetween(inputData): + retValue=False + for i in range(0,len(inputData)-2): + allThree=inputData[i]+inputData[i+1]+inputData[i+2] + if inputData[i] == inputData[i+2]: + retValue = True + break + return retValue + +def taskA (data) -> int: + gameScoreA = 0 + niceValue = 0 + for dataRow in data: + dataElems = list(dataRow) + is3Vocals = checkVocals(dataElems) + if is3Vocals == True: + isTwiceInRow = twiceInRow(dataElems) + if isTwiceInRow == True: + isNotContain = notContain(dataElems) + if isNotContain == False : + niceValue += 1 + gameScoreA = niceValue + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + niceValue = 0 + for dataRow in data: + dataElems = list(dataRow) + isDoubleTwice = doubleTwice(dataElems) + if isDoubleTwice == True: + isTwiceInBetween = twiceInBetween(dataElems) + if isTwiceInBetween == True: + niceValue += 1 + gameScoreB = niceValue + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day05/input.day05 b/2015/day05/input.day05 new file mode 100644 index 0000000..afc7b3d --- /dev/null +++ b/2015/day05/input.day05 @@ -0,0 +1,1000 @@ +rthkunfaakmwmush +qxlnvjguikqcyfzt +sleaoasjspnjctqt +lactpmehuhmzwfjl +bvggvrdgjcspkkyj +nwaceixfiasuzyoz +hsapdhrxlqoiumqw +lsitcmhlehasgejo +hksifrqlsiqkzyex +dfwuxtexmnvjyxqc +iawwfwylyrcbxwak +mamtkmvvaeeifnve +qiqtuihvsaeebjkd +skerkykytazvbupg +kgnxaylpgbdzedoo +plzkdktirhmumcuf +pexcckdvsrahvbop +jpocepxixeqjpigq +vnsvxizubavwrhtc +lqveclebkwnajppk +ikbzllevuwxscogb +xvfmkozbxzfuezjt +ukeazxczeejwoxli +tvtnlwcmhuezwney +hoamfvwwcarfuqro +wkvnmvqllphnsbnf +kiggbamoppmfhmlf +ughbudqakuskbiik +avccmveveqwhnjdx +llhqxueawluwmygt +mgkgxnkunzbvakiz +fwjbwmfxhkzmwtsq +kzmtudrtznhutukg +gtvnosbfetqiftmf +aoifrnnzufvhcwuy +cldmefgeuwlbxpof +xdqfinwotmffynqz +pajfvqhtlbhmyxai +jkacnevnrxpgxqal +esxqayxzvortsqgz +glfoarwvkzgybqlz +xdjcnevwhdfsnmma +jyjktscromovdchb +pvguwmhdvfxvapmz +iheglsjvxmkzgdbu +lwjioxdbyhqnwekv +zcoguugygkwizryj +ogvnripxxfeqpxdh +hkvajhsbfnzsygbm +cnjqeykecopwabpq +wojjtbcjinoiuhsj +kpwpvgxbyzczdzjq +wrvhylisemlewgzk +uiezkmnhilfzahtm +mucteynnuxpxzmvt +zaiwbgxefusfhmst +apptbogpxivjwink +qryboarjtwjhjgjb +irehxupgyseaahzd +fobstqxguyubggoh +ysriumfghtxtfxwe +auchdmasvfeliptw +mztuhefcrnknyrdl +tyjmkhihbwabjtaa +yquzkdtgsljkaebw +almvdvofjtkyzbmd +emqftiuqqpdwwbrv +hrrhmqfpepvbawvw +atrkgykycvgxbpyb +dhthetnealksbdan +zzqafhgicubptiyo +qdtaieaziwhbttnw +kyskgapdgqrtrefw +edwzlpqztpydmdlr +awszjnlmvlyqsuvl +kcrtmtshtsgixvcp +jtaskgkijivbbkri +mmggfwapsetemiuj +itagrrnjbnmhgppd +uqmbezechbrpbnqq +nnyimvtascflpzsa +knqeimypkdttyudj +vgoiyvtvegwyxjjd +qubzdxsbecktzrho +zehojtvktsbbxijb +xepmjrekwcgoxyoh +bnptxnocbpbqbyeq +sfvynsywscbnymos +dsltfbpcmffbluba +kncrlzlmkikylppa +siwudrvmildgaozv +jhhefbvbvneqzvtc +lqjgztxitbuccqbp +himmwlbhjqednltt +vwognchyertnnfil +eejakhapkbodrntf +qxuijkkhhlskgrba +aankpfxxicfpllog +vuxykvljyqexfhrn +epgygflbxlbwybzq +zuxmwvetmvcszayc +xttwhfqmemgtjnkf +hftwldmivyfunfvl +bejlyxfamzliilrj +zkehazcxyyvtrxti +dsgafehmcfpycvgz +igremmqdojqdvwmb +swnjzvmhcslvkmiw +fchzbfbmtqtxmaef +xwjmyyrlznxrcytq +brwcwzpcvbwdrthl +fvrlridacsiojdmb +mhsturxdlmtxozvy +usxvqyrwywdyvjvz +gwazuslvmarfpnzm +rgkbudaqsnolbcqo +dpxvlbtavdhdedkj +nnqmjzejhodyfgyd +ozoazxkfhujgtzvy +psdgvhzdiwnuaxpl +tznkilxpogbzgijz +wnpytcseirtborhh +lhauurlfsmagfges +oqfbzixnlywkzwwy +yoehapoyjpakziom +vtjftdcsfdzbmtrn +zcshfnodiwixcwqj +wapbxpaxgjvtntkm +qfyypkyvblrtaenh +bsxhbxkovgukhcza +kitdmvpiwzdonoyy +slkbhxmehzavbdsf +dovzjouqkzkcmbkl +qpbigdcqkfnfkxvq +eaiaquhnesvtcdsv +mhbezlhqojdsuryj +dqprkkzxlghkoccx +xqepmorryeivhrhm +frwmrjpezwmjflvf +gjpfgwghodfslwlf +fzyvajisdjbhfthq +pvzxkxdscdbilrdb +mtaxmqcnagmplvnm +rlyafujuuydrqwnc +gvqvrcxwyohufehq +lmrkircgfrfusmfd +ovlpnkxcpimyaspb +xhyjremmqhdqywju +pxfczlhpzbypfarm +utjhprzhtggausyp +utzkkzlnyskjtlqh +cecbcnxpazvkedic +xwvoaggihrbhmijq +krredhmtwlfmyagw +lwfhxgbknhwudkzw +vyczyvuxzmhxmdmn +swcoaosyieqekwxx +waohmlfdftjphpqw +gaclbbfqtiqasijg +ybcyaxhluxmiiagp +xgtxadsytgaznndw +wzqhtjqpaihyxksm +fdwltsowtcsmsyhm +rpoelfbsararhfja +tswgdacgnlhzwcvz +xjgbhdlxllgeigor +ksgthvrewhesuvke +whgooqirdjwsfhgi +toztqrxzavxmjewp +hbkayxxahipxnrtl +lazimkmdnhrtflcu +ndoudnupbotwqgmr +niwuwyhnudxmnnlk +hlmihzlrpnrtwekr +wzkttdudlgbvhqnc +rfyzzgytifkqlxjx +skddrtwxcyvhmjtb +mljspkvjxbuyhari +xwkhozaoancnwaud +nookruxkdffeymdz +oiqfvpxmcplyfgoa +qoxggshmrjlzarex +lsroezewzkrwdchx +nkoonmvdydgzspcl +lygxeqztdqklabov +jempjyzupwboieye +hpdaqkhjiddzybly +cvcizjlnzdjfjlbh +vaaddsbkcgdjhbkj +pjxmtxoyrkmpnenf +ujqdvyqnkbusxlps +miyvzkzqploqaceb +gapcsbkulicvlnmo +xqpcyriqhjhaeqlj +ipumdjwlldzqhmgh +swdstecnzttmehxe +ucmqordmzgioclle +aywgqhmqlrzcxmqx +ptkgyitqanvjocjn +wcesxtmzbzqedgfl +rnetcouciqdesloe +chpnkwfdjikqxwms +onpyrjowcuzdtzfg +tydnqwaqwkskcycz +dhamguhmkjzzeduy +oecllwyrlvsyeeuf +gsukajpoewxhqzft +sgdnffdixtxidkih +pqqzjxzydcvwwkmw +wnjltltufkgnrtgm +hylaicyfrqwolnaq +ovfnugjjwyfjunkm +xknyzsebmqodvhcl +uwfmrjzjvvzoaraw +zaldjvlcnqbessds +zphvjuctrsksouvz +ceqbneqjwyshgyge +wmelhaoylbyxcson +nghuescieaujhgkj +dhjmflwwnskrdpph +exvanqpoofjgiubf +aidkmnongrzjhsvn +mdbtkyjzpthewycc +izctbwnzorqwcqwz +hrvludvulaopcbrv +mrsjyjmjmbxyqbnz +sjdqrffsybmijezd +geozfiuqmentvlci +duzieldieeomrmcg +ehkbsecgugsulotm +cymnfvxkxeatztuq +bacrjsgrnbtmtmdl +kbarcowlijtzvhfb +uwietqeuupewbjav +ypenynjeuhpshdxw +fwwqvpgzquczqgso +wjegagwkzhmxqmdi +vocvrudgxdljwhcz +nnytqwspstuwiqep +axapfrlcanzgkpjs +lklrjiszochmmepj +gxadfpwiovjzsnpi +qidsjxzgwoqdrfie +wgszciclvsdxxoej +kwewlmzxruoojlaq +ywhahockhioribnz +ucbqdveieawzucef +mdyyzmfoaxmzddfv +hsxnabxyqfzceijv +vivruyvbrtaqeebr +jxfeweptjtgvmcjc +mmypqxmpurhculwd +mpiaphksvctnryli +xqzqnuxmuzylkkun +fndmtefjxxcygtji +dnorqlldvzqprird +nutokyajmjpwjaqu +vlupfperqyqkjcaj +dgihjeokrphkpdnk +nvbdyrlheqzixuku +mhrkntnxvsmvrpka +kvhkyanlhhymwljf +fhipumtegqfgeqqw +vpfjgveycdefuabu +kzincljffncylcsf +tsezxymwmjtyegqw +wxhcdrqedkdcwxli +ueihvxviirnooomi +kfelyctfvwyovlyh +horzapuapgtvzizz +iiqkdpmfvhwwzmtj +rsaclclupiicstff +quwkkhrafypkaoum +gyrgkgmwqfkeudfe +noydhbqacwptyfmy +efwwuipzgtkwffhf +suyojcitomdxsduh +lbcxnsykojkufkml +zpglsvoutvzkgdep +usgrufyvgsbsmbpr +katrrwuhwvunjqor +btngwrpcxoyfbgbc +bxjscjdiowjrkpns +nwxvnfrnlkgqxvhf +ikhyqkvljucgdlag +xibnxsjopmxvflkl +mzplumcfivqcjqnz +jqflcxoxzlbwlxry +fcscvmfepdxrshxe +wlpffwunffklzbuc +emvrlqajjgwzfmle +rhaheurtzrfoqkyq +ifuuhpxmadaysfsx +ncyfvleyzqntpcoo +zeogmyaqccmtvokd +jqppbzebppdnpurn +xixarswxsiwjzgni +ezruwzajsoombphs +hmiqfeizyprielxf +jnaoxljnftymsfey +extgzrxzovlsixnf +yhyfmovvlrwoezsv +ffnybaolppuzpjym +pqowimdiusccaagn +jgceiosiihpjsmnu +hkoexeaopebktngx +njhzuvsygymejqav +yjkgcclgtvushcfk +gmbjxhnkkxlihups +pdlwysadiebsidjz +omrwmgzulfoaqros +ofvvgdezwvcffdcy +otytpuklhxcpxhgd +eyfaosxdauumvlux +mvdthjfstrlqlyuo +mdgdchgnlxaxspdm +bakjezmhbwqxzevd +msakswaphdwaodhg +vjcqscgdbnsxdllh +jjywaovewbuzreoj +nqvplhwacylifvwk +lpwmpixbxysmsign +flcvbpxrchcpbgcb +qjpkeuenenwawlok +bnqkflfmdmntctya +fzsgzpoqixvpsneq +icwfdisutoilejld +relchofohnkwbumi +aljalgdaqwhzhfwr +cahkvnwnbwhodpqs +dnrzeunxiattlvdm +nsmkhlrpwlunppjs +mqqsexlwfqnogwub +tfavelkqrtndpait +ooguafrnmprfxcnz +ntynkiordzxtwrqa +rkkyzlxekqqlkvym +ofxcivdnwcmgfnme +ywotqwbrqxlrnobh +nrbbiypwhrqihvev +flqsjixxtydheufs +lcfrfzypstrqctja +hyzbuzawuzjrynny +exfbywcnstebnvmq +vydzwnbmcihvqrnj +qmwqaaylinzrdmiw +lpxpztpvfggspeun +lhxmqqbracsuyrfm +zgkwsrabaseidbrw +yjlmbhbqsqgszsun +mqfzqtbxtuteabtd +izomzdmcqmfrevwd +iqijrlqurdwrkoln +fxhqzpgoxxjkkhql +oulwontmgrjeopnk +edaigfydjexvzzvj +vjhybiklxpxjqpwc +ypxfbfnpbmqmwtte +xzvcsgasztrxdzud +rpulqmobptfarboo +palacmdijxzzykrf +jmllwukplufohiby +dnswayomusiekfmy +sxbrjqtqgzzwhcfo +lylvndsgbnbqiejm +jaxxhoulxnxnaenr +nblissutfazbcpwn +zmlsjszzldvbiacr +kewojtlchfkclqwk +eqvfjasddggvfame +yibzqlvxtraxpdon +dgnbxsbmdrtyvaac +uoxrcxfimhgtxqhy +xfdxalrwcwudlviq +xmtbdklqptoswpwl +zezyopzdztdjerfl +xuzluhjsqvhytgbc +qdjtmeckispmgzki +phakupesplzmmmvc +gpuoqfffumzszybn +bhywxqkrrlwuebbw +ibvwgoyvelzenkzl +ncohvvbmiekbaksa +fzuvqzvxvdbeirrp +lshtzniokucwojjd +punrduvlnrulkium +gnfpikidnfobrrme +vxkvweekmnvkzgyl +rhydssudkcjlqgxn +cjtqvlaahohcgumo +jwzmfyinsfwecgcb +blpeseqhlzfilpuf +jvtpjkyokzcvagon +qjomincbcobjczpe +ugsyzkzgdhxtmsfz +hleaqgwzqjwajcra +coumfghptpnxvvov +hqpnbupnzwpdvgqd +cpouyodqxgviasem +lljvxeyozckifhfd +huqtnvutdyfgwtwa +yenlveuynmlmmymu +ojdyufkomxiwjmbf +spjzgvcwvzgffjkk +vxykmjhyvmhyssbp +tazdeqggfcjfvwwn +uumwcngwcytvpufx +avovuzkrevloneop +owczrtbnrvjfemkt +hzpugcanaxyvaokj +iishlodnxvjtgzyn +qosdonclrnxirham +eonqlnwevahydddg +ryqmnuikftlxuoqy +whqepbcwabzbthha +vekisvnwhgpyemxr +lrwxzoamnvpnlhap +ywepvqthnorfswjv +evqwvsoazmwyypjy +bgwoojddubppmjxf +jypkfrthzgtyeddi +tynabbhfjzkrqsju +adxstbfqheuqbcuk +gqwqiocdyqoiblrx +ybuddlyuskdlegxv +luwynbsmpgyeqsbr +ltyqgqoyljibqndo +jaedpajzphfybajh +epglnrxofptsqvmy +zjdpxkngfkstxbxh +ekegphcwanoickfu +cqvhuucvejqirvfs +uqudnnqumsqcgefo +qnzunermlnpcfflo +ovyxaniqaawzfuxx +djekxcezjowdhopq +bwtwbmdehrhpjnlk +nilsnlacerweikfa +hyrigsrmsrzcyaus +gvmdmgddduylmxic +ewzovdblhmjgjwsk +ojjfsknlonzguzlq +yjgfruvpjvlvrvvq +cyoryodwyhzwprbv +crsjclrurcquqgut +sjhfhobwtojxcmem +ibxfjudilmdeksea +uqbhdbjoeupyhbcz +uqbxigzxuxgmjgnw +jashafmtzrhswirg +dexiolovaucyooka +czjbwwnlwcoqnoiu +ojigosazigfhttjc +zfiqtgrqbmftknzn +dlzbmvmolssbqlzl +sgmchcurrutdtsmw +scdwjqsdohcdrwry +cgtdvecqwplpprxn +iiplenflfczaktwi +wmgnwfxfcjhyeiqg +giihshowtcatecvl +nqhzfincclumvkaz +kxstpzgdfvepionc +agbhxcijxjxerxyi +hmgfqevgdyvisyvs +tthakmvpowpvhtao +ottalcghygpaafbo +aplvozayycremgqg +dbjxlnaouxqtdpfz +peeyallzjsdvpalc +ndtdjyboixuyhfox +llabnbcobexfoldn +cweuvfnfyumbjvxr +ewkhhepaosalnvkk +pivyiwsiqpwhagyx +auzsnwdcerfttawt +grbfrekupciuzkrt +byfwzadtzrbndluf +lluypxjeljzquptk +pskwsnhqanemtfou +sxvrtqqjdjkfhhrm +ulsmqgmshvijyeqh +qigofesfhekoftkf +zhatniakqtqcxyqa +uuczvylgnxkenqee +mlitvtuxknihmisc +srrtrxdvcokpyfmz +osispuucklxcfkeb +vqhazlaulmnpipql +umkiueljberqhdig +knvpbkbvgoqzwprp +nbsocqikhuvsbloj +wjnpepjkzkednqbm +agbhmytsofuyqcor +gvogzhkkpxyfecko +ardafguxifeipxcn +yiajcskbgykyzzkw +sejunbydztyibnpq +dqrgfggwcnxeiygy +xnqqwilzfbhcweel +jjtifhlvmyfxajqi +gwszrpgpmbpiwhek +kydzftzgcidiohfd +efprvslgkhboujic +kecjdfwqimkzuynx +rildnxnexlvrvxts +dlnhjbqjrzpfgjlk +qluoxmzyhkbyvhub +crydevvrjfmsypbi +dosaftwumofnjvix +pwsqxrfwigeffvef +nzyfmnpwqyygjvfx +iccbckrkxlwjsjat +bmputypderxzrwab +bhuakynbwnlreixb +qmrzfyqjiwaawvvk +juvtixbkwyludftn +zapmjxmuvhuqlfol +paiwrqjhpjavuivm +tsepfbiqhhkbyriz +jpprewufiogxoygk +mmapyxbsugcsngef +pduhmgnepnpsshnh +aetndoqjvqyjrwut +fnfvlorhwpkkemhz +gedfidpwvoeazztl +beclvhospgtowaue +wsclsvthxustmczm +tjbxhnpniuikijhe +rhetyhvfcemponeg +mavonujurprbeexi +argbrpomztrdyasa +bzvtffbtygjxmkvh +maqyqkhsqgzfzvve +seeirbiynilkhfcr +wxmanwnozfrlxhwr +dieulypsobhuvswb +nxevassztkpnvxtb +jclxuynjsrezvlcy +xlolzyvgmwjsbmyf +tguzoeybelluxwxc +fkchoysvdoaasykz +cyynwbfcqpqapldf +rhifmzpddjykktuy +ndvufsyusbxcsotm +txutnzvdsorrixgg +qjoczhukbliojneu +ufhwujotncovjjsz +kclsgsdwcrxsycbr +yscwmlrdaueniiic +nxhivrovpkgsmugb +fdxqfyvwwvgeuqkv +femtamfylysohmpr +amsyzslvyxsoribh +nhmqxncwsonhgbcz +uomqsvcbpthlmcue +kxtfapcqrnjkkslj +xtieihonlfubeync +adpcjqxgydulchgj +cjynnzsmmujsxxpd +neeapmzweidordog +szoivgqyqwnyjsnk +uwgrtzaqezgphdcu +ptpgttqxocjwxohi +fhltebsizfwzpgpf +emmsazsidspkhgnh +dxcprkbcjeqxqzgn +tpxzqwxbzwigdtlt +afsmksnmzustfqyt +xyehnftstacyfpit +vcrfqumhjcmnurlw +rrznpjzcjgnugoch +gbxnzkwsjmepvgzk +jwobshgwerborffm +zmuvfkhohoznmifs +buyuwgynbtujtura +bevncenmpxfyzwtf +hqqtcrhzfsrcutjh +kbpzshllpiowepgc +alspewedcukgtvso +xvsvzzdcgjuvutrw +pmwulqraatlbuski +abuzsiinbueowpqn +oedruzahyfuchijk +avhcuhqqjuqkesoq +azqgplkzsawkvnhb +rjyoydogkzohhcvx +aezxwucqvqxuqotb +kxobnsjvzvenyhbu +nnjoiilshoavzwly +aijttlxjrqwaewgk +cvsaujkqfoixarsw +zngtoacpxcsplgal +qhkxliqtokvepcdv +aixihrtdmxkfvcqw +owbgdgdymxhhnoum +tajsagmruwzuakkd +ckrfduwmsodeuebj +alfdhuijuwyufnne +xpchlkijwuftgmnm +rwcrvgphistiihlg +xdaksnorrnkihreq +akeschycpnyyuiug +rgputhzsvngfuovz +lerknhznuxzdhvre +mqiqmyladulbkzve +csnmupielbbpyops +kwgrwgmhfzjbwxxz +npwtvbslvlxvtjsd +zxleuskblzjfmxgf +hexvporkmherrtrn +rhtdhcagicfndmbm +qhnzyuswqwoobuzz +dpvanjuofrbueoza +kjcqujmnhkjdmrrf +gholddsspmxtpybg +jihlvyqdyzkshfsi +zuviqmuqqfmtneur +kzexjowatvkohrtx +wgijnfhibsiruvnl +zevkrkmhsxmicijb +khxrcteqourjvoxa +ylpxlkcnenbxxtta +zrfsvctbojjkpvtw +nlzbudxibnmcrxbt +cqnscphbicqmyrex +ywvdohheukipshcw +riwatbvjqstubssf +idlztqqaxzjiyllu +sdpdgzemlqtizgxn +rjtbovqlgcgojyjx +fnfrfwujmjwdrbdr +osnppzzmrpxmdhtj +ljhwngclvydkwyoe +chwqkrkzrvjwarat +jmydkwpibkvmqlgs +zvhfmbxnlxtujpcz +jsnhsphowlqupqwj +fzhkkbpasthopdev +jerntjdsspdstyhf +gctwmaywbyrzwdxz +xemeaiuzlctijykr +xulrqevtbhplmgxc +yfejfizzsycecqpu +gboxrvvxyzcowtzm +lpvhcxtchwvpgaxp +wdiwucbdyxwnjdqf +qgwoqazzjlvnjrwj +prtlnkakjfqcjngn +fagvxsvjpuvqxniz +xacmxveueaakfbsm +ginvtonnfbnugkpz +qpvggsppewfzvwin +reoqnlzruyyfraxa +kolwtqhifjbbuzor +vrkcywvdhdprztww +ngdvyfmvjqhbzbxt +rooxeoilqzqjunmp +efxmdprtogtxgyqs +qrhjuqndgurcmwgu +ouitjprueefafzpl +kirdwcksqrbwbchp +fpumsmogojuywezo +lgjrgykywugzjees +xigioqcpjabpbdas +ewkhuprpqzikmeop +fgrgxsqeducigxvr +bclkursnqkzmjihl +jozidniwvnqhvsbc +oghcilcyozrmmpta +xbgmaungzcpasapi +iqowypfiayzbcvhv +opdehgwdgkocrgkf +zfzvdjeinlegcjba +vhakxvlcayuzukap +xyradgyiebpevnwe +eamhtflgedwyshkn +igteqdgchjeulfth +kwsfkigxzpbgdxod +vapnpsbdboiewpzp +wbuqhjsngxpqshen +vxxilouxuytitwgm +cpnwlkwnkeanqnet +wdmbtqvvlowftvgb +wjtmcecpyqzwpbqg +jnxmoxdhvsphcdeg +wabxfxpotoywwodn +mwbsoxzlqpqobvvh +coktshbyzjkxnwlt +rzhnggpslwzvyqrp +dgzuqbzarbutlkfx +wunajaiiwgijfvjh +uotdbcgmsvbsfqlb +kxdtlgmqbccjqldb +ngmjzjwvwbegehfr +cvpsabqfpyygwncs +wqluvqlhdhskgmzj +rbveperybfntcfxs +fbmoypqdyyvqyknz +zxpgzwnvmuvkbgov +yexcyzhyrpluxfbj +ltqaihhstpzgyiou +munhsdsfkjebdicd +plecvjctydfbanep +kjrxnnlqrpcieuwx +zbcdtcqakhobuscf +kgovoohchranhmsh +llxufffkyvuxcmfx +tgaswqyzqopfvxtw +kojcqjkdpzvbtjtv +xggdlkmkrsygzcfk +vvitpsnjtdqwyzhh +gcqjuwytlhxsecci +vbsghygcsokphnrg +vejqximdopiztjjm +hudqtwmwkviiuslp +vwswfvpcwwpxlyry +gxmfiehdxptweweq +qjmekjdcedfasopf +pqyxdxtryfnihphf +felnavctjjojdlgp +hbimufguekgdxdac +dhxhtnqgfczywxlr +pssottpdjxkejjrh +edieanguabapxyig +sciinanyqblrbzbb +irxpsorkpcpahiqi +qsxecaykkmtfisei +ivfwlvxlbnrzixff +hqxzzfulfxpmivcw +vvbpaepmhmvqykdg +cetgicjasozykgje +wuetifzdarhwmhji +gaozwhpoickokgby +eldnodziomvdfbuv +favpaqktqaqgixtv +twbcobsayaecyxvu +lzyzjihydpfjgqev +wnurwckqgufskuoh +fxogtycnnmcbgvqz +aetositiahrhzidz +dyklsmlyvgcmtswr +ykaxtdkjqevtttbx +kfmnceyxyhiczzjm +nnizopcndipffpko +yjmznhzyfinpmvkb +sljegcvvbnjhhwdd +zmkeadxlwhfahpwg +rwvcogvegcohcrmx +aguqwrfymwbpscau +vlusytjagzvsnbwe +smvzhburcgvqtklh +rfuprvjkhazrcxpv +megqlnoqmymcrclc +gvldhkewtmlwqvqv +awynhvtyziemnjoa +voprnvtnzspfvpeh +dhlguqwmunbbekih +goayirdhnjrfuiqi +eoghydfykxdslohz +chpippjykogxpbxq +hqbycjweqczwjwgf +pvefsrvwumrlvhmt +eghwdovaynmctktk +crwkxoucibumzawc +bzbtahvhkdigvvtj +bnbptgihhfubxhho +ddqmbwyfmfnjjaro +gvtswqyzazihctif +vmqctjpgadxztqqb +dgnndowtpeooaqqf +sxdvctfdtalufxty +ylgeexosibsmmckw +sxplpyskbpqnojvw +coarhxtsvrontyeg +fyoaurggjupvzvlv +jlyrkqsiwuggvjem +uwbsjoxonreuucyi +gihuqvwxovbgokes +dxzaaxupbcgnxcwf +gidrgmvyrlqqslve +csflmlvqmonoywpx +jkxkpixlythlacnk +ejkarcdkdslldugv +dbzmsusevohhjkmr +cbrqzualjpdtworc +kpgidqlmcbpfmmwu +zwghjuofexfowqam +ncdlxmcrsmsocetz +kfprzqacefifjkbd +swwzivrxulkhvldc +wgqejhigbjwunscp +rsstnwcyybfauqxu +qhngfxyhdqopyfgk +zrndpyyejsmqsiaj +xxknxwpvafxiwwjc +mmaahwgoiwbxloem +tabacndyodmpuovp +yriwomauudscvdce +duvyscvfidmtcugl +mgipxnqlfpjdilge +imeeqcdetjuhfjnw +dvkutrdofpulqkyh +jefvtlktxegpmbya +iyzudqgpvlzjfydh +giohapxnpaqayryd +qheqdprmnqlpztls +rdxhijmzegxkotoq +hdnmaspumdwnrcdz +wafpbgehbuzdgsnc +tbtrfztsferdmhsy +vusndcyjngtkrtmk +ilqblestzxebcifh +urfgjbjgzlrfsdlv +aptcdvpsqwleqttn +bigczjvzokvfofiw +zjnjeufonyqgkbpx +trcdebioegfqrrdi +jrdvdriujlmbqewt +jqrcmuxpwurdhaue +yjlermsgruublkly +zwarvgszuqeesuwq +xthhhqzwvqiyctvs +mzwwaxnbdxhajyyv +nclsozlqrjvqifyi +gcnyqmhezcqvksqw +deuakiskeuwdfxwp +tclkbhqqcydlgrrl +qbpndlfjayowkcrx +apjhkutpoiegnxfx +oaupiimsplsvcsie +sdmxrufyhztxzgmt +ukfoinnlbqrgzdeh +azosvwtcipqzckns +mydyeqsimocdikzn +itfmfjrclmglcrkc +swknpgysfscdrnop +shyyuvvldmqheuiv +tljrjohwhhekyhle +dayinwzuvzimvzjw +qgylixuuervyylur +klqqaiemurawmaaz +hdmzgtxxjabplxvf +xiivzelzdjjtkhnj +ktgplkzblgxwrnvo +gvbpyofzodnknytd +lqhlmnmhakqeffqw +ltzdbngrcxwuxecy +obxnfjeebvovjcjz +zexpwallpocrxpvp +tjpkkmcqbbkxaiak +qiedfixxgvciblih +qcxkhghosuslbyih +gnsfidwhzaxjufgm +xrghwgvyjakkzidw +tftftwedtecglavz +wquqczzkzqrlfngr +twibtkijpvzbsfro +bmplypdsvzuhrjxp +zanrfmestvqpwbuh +zonrhfqowyimcukm +kpvajjfmqpbhrjma +kujzluicngigjbtp +iusguantsrwxdjal +kwxeuylcnszswahw +visdhnkobxnemldu +rogeadmmaicwtabl +pxqycifbgevqudvs +osaiozyvlyddylqr +vffjxrolrpuxcatx +jbmsetccdrywssjd +qgxyhjfpbfifmvgc +npejgalglldxjdhs +mbbtqgmttastrlck +whapaqwdtpkropek +dulbdboxazfyjgkg +xaymnudlozbykgow +lebvqmxeaymkkfoy +bmicnfuubkregouj +dieatyxxxlvhneoj +yglaapcsnsbuvrva +bbpjaslqpzqcwkpk +xehuznbayagrbhnd +ikqmeovaurmqfuvr +ylyokwuzxltvxmgv +hqtfinrkllhqtoiz +pjmhtigznoaejifx +fqdbmowkjtmvvrmx +uvqtqfoulvzozfxv +rpajajukuxtchrjd +sznucejifktvxdre +ufvibsmoushmjbne +xirdqoshngthfvax +iafpkddchsgdqmzl +vmualmlduipvykzh +fnmuahmblwyceejb +ilsaapnswfoymiov +lenvylifraahaclv +cukqxlipuyxedqfh +zgwecslpniqvtvuz +cdcdfpsxuyrhsmag +dszjinhantnxgqra +ioimwotsgnjeacgt +dqcymnvjystbynhp +yibaudyfefbfgunx +cabslcvunjavqkbf +goymzvmgkvlsmugf +zxteiitpthzskjjx +agnxcnaqhjhlurzs +cvmgyxhhnykuxbmb +cgqmjexydmvgwxpp +sygjajofieojiuna +clpvxbrbjvqfbzvu +cbntswqynsdqnhyv +bztpbtwbefiotkfa +pnxccbgajvhyeybu +asyzrvgzumtuissa +facjyblvcqqginxa +rvwnucnbsvberxuv +ghrbeykzrxclasie +ekujtselepgjtaql +krtrzsmduhsifyiw +ticjswvsnyrwhpnt +clmjhsftkfjzwyke +lbxlcixxcztddlam +xhfeekmxgbloguri +azxqwlucwhahtvep +kitdjrwmockhksow +keznwwcusgbtvfrs +ljvzxoywcofgwajj +vebjnhnkcfzbhrcw +eqfcxkavstxcuels +ldattkyawjrvcido +bsqqeilshcwtqyil +foqqsxahfiozcqrw +liswfmuhzfbyzjhf +sulbdcyzmolapfbs +zuggzkelwxjpsgxb +betioxrgtnhpivcw +xmtbixstdipibhgs +ttvurgqmulryyaji +viobnljznzppfmxw +qlzabfopydtxrlet +tusvydegfxhaxolk +thoufvvfjferxhwp +cfyyzppfarjiilbs +jwmhxtgafkkgseqs +pqwuuaxbeklodwpt +vndyveahdiwgkjyx +ssrjgasfhdouwyoh +thbavfcisgvvyekf +yjdvxmubvqadgypa +tlbmcxaelkouhsvu +bonohfnlboxiezzr +rktlxcbkhewyvcjl +rsmoutcbcssodvsc +qszdratuxcrhsvoh +eypyfahpuzqwzwhi +yhkrleqmqlmwdnio +vpnvxusvmngsobmq +hkzyhopvxrsimzys +dblriiwnrvnhxykl +xkriqxkrprjwpncs +rcymltrbszhyhqti +mzbvneplsnpiztzn +vkqtnptgbqefvfoc +nwdtfiaozkcjtlax +crximadpvdaccrsm +lrbajafxwwnxvbei +rbexzesrytpwwmjf +stxwjarildpnzfpg +btamaihdivrhhrrv +acqbucebpaulpotl +dkjhzghxxtxgdpvm +rsbzwsnvlpqzyjir +mizypbwvpgqoiams +nvrslorjpqaasudn +wvexcpzmconqkbvk +rfwfumhjwzrvdzam +eaghdaqorkhdsmth +gtuntmpqaivosewh +nzlsmdgjrigghrmy +dhuvxwobpzbuwjgk +kkcuvbezftvkhebf +aeediumxyljbuyqu +rfkpqeekjezejtjc +wkzasuyckmgwddwy +eixpkpdhsjmynxhi +elrlnndorggmmhmx +ayxwhkxahljoxggy +mtzvvwmwexkberaw +evpktriyydxvdhpx +otznecuqsfagruls +vrdykpyebzyblnut +cnriedolerlhbqjy +uajaprnrrkvggqgx +xdlxuguloojvskjq +mfifrjamczjncuym +otmgvsykuuxrluky +oiuroieurpyejuvm \ No newline at end of file diff --git a/2015/day05/sample.day05 b/2015/day05/sample.day05 new file mode 100644 index 0000000..cdf07f1 --- /dev/null +++ b/2015/day05/sample.day05 @@ -0,0 +1,4 @@ +qjhvhtzxzqqjkmpb +xxyxx +uurcxstgmygtbstg +ieodomkazucvgmuy \ No newline at end of file diff --git a/2015/day06.py b/2015/day06.py new file mode 100644 index 0000000..c6838f6 --- /dev/null +++ b/2015/day06.py @@ -0,0 +1,87 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def turnLight(data,mode: int): + score=0 + dataCommands = [] + board = {} + + for dataRow in data: + dataCommands.append(dataRow.replace('turn ','').replace(' through ',' ').replace(' ',',')) + for dataCommand in dataCommands: + command,startCoordX,startCoordY,endCoordX,endCoordY = dataCommand.split(',') + for i in range(int(startCoordX),int(endCoordX)+1): + for j in range(int(startCoordY), int(endCoordY)+1): + coordXY = (i,j) + if mode == 0: + if command == 'on': + board[coordXY]=1 + elif command == 'off': + board[coordXY]=0 + elif command == 'toggle': + try: + board[coordXY]=board[coordXY] ^ 1 + except: + board[coordXY] = 1 + else: + if command == 'on': + try: + board[coordXY]+=1 + except: + board[coordXY]=1 + elif command == 'off': + try: + if board[coordXY] > 0 : board[coordXY]-=1 + except: + board[coordXY]=0 + elif command == 'toggle': + try: + board[coordXY]+=2 + except: + board[coordXY]=2 + for key,scoreValue in board.items(): + score += scoreValue + return score + +def taskA (data) -> int: + return turnLight(data,0) + +def taskB (data) -> int: + return turnLight(data,1) + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day06/input.day06 b/2015/day06/input.day06 new file mode 100644 index 0000000..459b435 --- /dev/null +++ b/2015/day06/input.day06 @@ -0,0 +1,300 @@ +turn on 887,9 through 959,629 +turn on 454,398 through 844,448 +turn off 539,243 through 559,965 +turn off 370,819 through 676,868 +turn off 145,40 through 370,997 +turn off 301,3 through 808,453 +turn on 351,678 through 951,908 +toggle 720,196 through 897,994 +toggle 831,394 through 904,860 +toggle 753,664 through 970,926 +turn off 150,300 through 213,740 +turn on 141,242 through 932,871 +toggle 294,259 through 474,326 +toggle 678,333 through 752,957 +toggle 393,804 through 510,976 +turn off 6,964 through 411,976 +turn off 33,572 through 978,590 +turn on 579,693 through 650,978 +turn on 150,20 through 652,719 +turn off 782,143 through 808,802 +turn off 240,377 through 761,468 +turn off 899,828 through 958,967 +turn on 613,565 through 952,659 +turn on 295,36 through 964,978 +toggle 846,296 through 969,528 +turn off 211,254 through 529,491 +turn off 231,594 through 406,794 +turn off 169,791 through 758,942 +turn on 955,440 through 980,477 +toggle 944,498 through 995,928 +turn on 519,391 through 605,718 +toggle 521,303 through 617,366 +turn off 524,349 through 694,791 +toggle 391,87 through 499,792 +toggle 562,527 through 668,935 +turn off 68,358 through 857,453 +toggle 815,811 through 889,828 +turn off 666,61 through 768,87 +turn on 27,501 through 921,952 +turn on 953,102 through 983,471 +turn on 277,552 through 451,723 +turn off 64,253 through 655,960 +turn on 47,485 through 734,977 +turn off 59,119 through 699,734 +toggle 407,898 through 493,955 +toggle 912,966 through 949,991 +turn on 479,990 through 895,990 +toggle 390,589 through 869,766 +toggle 593,903 through 926,943 +toggle 358,439 through 870,528 +turn off 649,410 through 652,875 +turn on 629,834 through 712,895 +toggle 254,555 through 770,901 +toggle 641,832 through 947,850 +turn on 268,448 through 743,777 +turn off 512,123 through 625,874 +turn off 498,262 through 930,811 +turn off 835,158 through 886,242 +toggle 546,310 through 607,773 +turn on 501,505 through 896,909 +turn off 666,796 through 817,924 +toggle 987,789 through 993,809 +toggle 745,8 through 860,693 +toggle 181,983 through 731,988 +turn on 826,174 through 924,883 +turn on 239,228 through 843,993 +turn on 205,613 through 891,667 +toggle 867,873 through 984,896 +turn on 628,251 through 677,681 +toggle 276,956 through 631,964 +turn on 78,358 through 974,713 +turn on 521,360 through 773,597 +turn off 963,52 through 979,502 +turn on 117,151 through 934,622 +toggle 237,91 through 528,164 +turn on 944,269 through 975,453 +toggle 979,460 through 988,964 +turn off 440,254 through 681,507 +toggle 347,100 through 896,785 +turn off 329,592 through 369,985 +turn on 931,960 through 979,985 +toggle 703,3 through 776,36 +toggle 798,120 through 908,550 +turn off 186,605 through 914,709 +turn off 921,725 through 979,956 +toggle 167,34 through 735,249 +turn on 726,781 through 987,936 +toggle 720,336 through 847,756 +turn on 171,630 through 656,769 +turn off 417,276 through 751,500 +toggle 559,485 through 584,534 +turn on 568,629 through 690,873 +toggle 248,712 through 277,988 +toggle 345,594 through 812,723 +turn off 800,108 through 834,618 +turn off 967,439 through 986,869 +turn on 842,209 through 955,529 +turn on 132,653 through 357,696 +turn on 817,38 through 973,662 +turn off 569,816 through 721,861 +turn on 568,429 through 945,724 +turn on 77,458 through 844,685 +turn off 138,78 through 498,851 +turn on 136,21 through 252,986 +turn off 2,460 through 863,472 +turn on 172,81 through 839,332 +turn on 123,216 through 703,384 +turn off 879,644 through 944,887 +toggle 227,491 through 504,793 +toggle 580,418 through 741,479 +toggle 65,276 through 414,299 +toggle 482,486 through 838,931 +turn off 557,768 through 950,927 +turn off 615,617 through 955,864 +turn on 859,886 through 923,919 +turn on 391,330 through 499,971 +toggle 521,835 through 613,847 +turn on 822,787 through 989,847 +turn on 192,142 through 357,846 +turn off 564,945 through 985,945 +turn off 479,361 through 703,799 +toggle 56,481 through 489,978 +turn off 632,991 through 774,998 +toggle 723,526 through 945,792 +turn on 344,149 through 441,640 +toggle 568,927 through 624,952 +turn on 621,784 through 970,788 +toggle 665,783 through 795,981 +toggle 386,610 through 817,730 +toggle 440,399 through 734,417 +toggle 939,201 through 978,803 +turn off 395,883 through 554,929 +turn on 340,309 through 637,561 +turn off 875,147 through 946,481 +turn off 945,837 through 957,922 +turn off 429,982 through 691,991 +toggle 227,137 through 439,822 +toggle 4,848 through 7,932 +turn off 545,146 through 756,943 +turn on 763,863 through 937,994 +turn on 232,94 through 404,502 +turn off 742,254 through 930,512 +turn on 91,931 through 101,942 +toggle 585,106 through 651,425 +turn on 506,700 through 567,960 +turn off 548,44 through 718,352 +turn off 194,827 through 673,859 +turn off 6,645 through 509,764 +turn off 13,230 through 821,361 +turn on 734,629 through 919,631 +toggle 788,552 through 957,972 +toggle 244,747 through 849,773 +turn off 162,553 through 276,887 +turn off 569,577 through 587,604 +turn off 799,482 through 854,956 +turn on 744,535 through 909,802 +toggle 330,641 through 396,986 +turn off 927,458 through 966,564 +toggle 984,486 through 986,913 +toggle 519,682 through 632,708 +turn on 984,977 through 989,986 +toggle 766,423 through 934,495 +turn on 17,509 through 947,718 +turn on 413,783 through 631,903 +turn on 482,370 through 493,688 +turn on 433,859 through 628,938 +turn off 769,549 through 945,810 +turn on 178,853 through 539,941 +turn off 203,251 through 692,433 +turn off 525,638 through 955,794 +turn on 169,70 through 764,939 +toggle 59,352 through 896,404 +toggle 143,245 through 707,320 +turn off 103,35 through 160,949 +toggle 496,24 through 669,507 +turn off 581,847 through 847,903 +turn on 689,153 through 733,562 +turn on 821,487 through 839,699 +turn on 837,627 through 978,723 +toggle 96,748 through 973,753 +toggle 99,818 through 609,995 +turn on 731,193 through 756,509 +turn off 622,55 through 813,365 +turn on 456,490 through 576,548 +turn on 48,421 through 163,674 +turn off 853,861 through 924,964 +turn off 59,963 through 556,987 +turn on 458,710 through 688,847 +toggle 12,484 through 878,562 +turn off 241,964 through 799,983 +turn off 434,299 through 845,772 +toggle 896,725 through 956,847 +turn on 740,289 through 784,345 +turn off 395,840 through 822,845 +turn on 955,224 through 996,953 +turn off 710,186 through 957,722 +turn off 485,949 through 869,985 +turn on 848,209 through 975,376 +toggle 221,241 through 906,384 +turn on 588,49 through 927,496 +turn on 273,332 through 735,725 +turn on 505,962 through 895,962 +toggle 820,112 through 923,143 +turn on 919,792 through 978,982 +toggle 489,461 through 910,737 +turn off 202,642 through 638,940 +turn off 708,953 through 970,960 +toggle 437,291 through 546,381 +turn on 409,358 through 837,479 +turn off 756,279 through 870,943 +turn off 154,657 through 375,703 +turn off 524,622 through 995,779 +toggle 514,221 through 651,850 +toggle 808,464 through 886,646 +toggle 483,537 through 739,840 +toggle 654,769 through 831,825 +turn off 326,37 through 631,69 +turn off 590,570 through 926,656 +turn off 881,913 through 911,998 +turn on 996,102 through 998,616 +turn off 677,503 through 828,563 +turn on 860,251 through 877,441 +turn off 964,100 through 982,377 +toggle 888,403 through 961,597 +turn off 632,240 through 938,968 +toggle 731,176 through 932,413 +turn on 5,498 through 203,835 +turn on 819,352 through 929,855 +toggle 393,813 through 832,816 +toggle 725,689 through 967,888 +turn on 968,950 through 969,983 +turn off 152,628 through 582,896 +turn off 165,844 through 459,935 +turn off 882,741 through 974,786 +turn off 283,179 through 731,899 +toggle 197,366 through 682,445 +turn on 106,309 through 120,813 +toggle 950,387 through 967,782 +turn off 274,603 through 383,759 +turn off 155,665 through 284,787 +toggle 551,871 through 860,962 +turn off 30,826 through 598,892 +toggle 76,552 through 977,888 +turn on 938,180 through 994,997 +toggle 62,381 through 993,656 +toggle 625,861 through 921,941 +turn on 685,311 through 872,521 +turn on 124,934 through 530,962 +turn on 606,379 through 961,867 +turn off 792,735 through 946,783 +turn on 417,480 through 860,598 +toggle 178,91 through 481,887 +turn off 23,935 through 833,962 +toggle 317,14 through 793,425 +turn on 986,89 through 999,613 +turn off 359,201 through 560,554 +turn off 729,494 through 942,626 +turn on 204,143 through 876,610 +toggle 474,97 through 636,542 +turn off 902,924 through 976,973 +turn off 389,442 through 824,638 +turn off 622,863 through 798,863 +turn on 840,622 through 978,920 +toggle 567,374 through 925,439 +turn off 643,319 through 935,662 +toggle 185,42 through 294,810 +turn on 47,124 through 598,880 +toggle 828,303 through 979,770 +turn off 174,272 through 280,311 +turn off 540,50 through 880,212 +turn on 141,994 through 221,998 +turn on 476,695 through 483,901 +turn on 960,216 through 972,502 +toggle 752,335 through 957,733 +turn off 419,713 through 537,998 +toggle 772,846 through 994,888 +turn on 881,159 through 902,312 +turn off 537,651 through 641,816 +toggle 561,947 through 638,965 +turn on 368,458 through 437,612 +turn on 290,149 through 705,919 +turn on 711,918 through 974,945 +toggle 916,242 through 926,786 +toggle 522,272 through 773,314 +turn on 432,897 through 440,954 +turn off 132,169 through 775,380 +toggle 52,205 through 693,747 +toggle 926,309 through 976,669 +turn off 838,342 through 938,444 +turn on 144,431 through 260,951 +toggle 780,318 through 975,495 +turn off 185,412 through 796,541 +turn on 879,548 through 892,860 +turn on 294,132 through 460,338 +turn on 823,500 through 899,529 +turn off 225,603 through 483,920 +toggle 717,493 through 930,875 +toggle 534,948 through 599,968 +turn on 522,730 through 968,950 +turn off 102,229 through 674,529 \ No newline at end of file diff --git a/2015/day06/sample.day06 b/2015/day06/sample.day06 new file mode 100644 index 0000000..c2353b9 --- /dev/null +++ b/2015/day06/sample.day06 @@ -0,0 +1,3 @@ +turn on 0,0 through 999,999 +toggle 0,0 through 999,0 +turn off 499,499 through 500,500 \ No newline at end of file diff --git a/2015/day07.py b/2015/day07.py new file mode 100644 index 0000000..4c8b226 --- /dev/null +++ b/2015/day07.py @@ -0,0 +1,49 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(True) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + for dataRow in data: + + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day07/input.day07 b/2015/day07/input.day07 new file mode 100644 index 0000000..1034292 --- /dev/null +++ b/2015/day07/input.day07 @@ -0,0 +1,339 @@ +lf AND lq -> ls +iu RSHIFT 1 -> jn +bo OR bu -> bv +gj RSHIFT 1 -> hc +et RSHIFT 2 -> eu +bv AND bx -> by +is OR it -> iu +b OR n -> o +gf OR ge -> gg +NOT kt -> ku +ea AND eb -> ed +kl OR kr -> ks +hi AND hk -> hl +au AND av -> ax +lf RSHIFT 2 -> lg +dd RSHIFT 3 -> df +eu AND fa -> fc +df AND dg -> di +ip LSHIFT 15 -> it +NOT el -> em +et OR fe -> ff +fj LSHIFT 15 -> fn +t OR s -> u +ly OR lz -> ma +ko AND kq -> kr +NOT fx -> fy +et RSHIFT 1 -> fm +eu OR fa -> fb +dd RSHIFT 2 -> de +NOT go -> gp +kb AND kd -> ke +hg OR hh -> hi +jm LSHIFT 1 -> kg +NOT cn -> co +jp RSHIFT 2 -> jq +jp RSHIFT 5 -> js +1 AND io -> ip +eo LSHIFT 15 -> es +1 AND jj -> jk +g AND i -> j +ci RSHIFT 3 -> ck +gn AND gp -> gq +fs AND fu -> fv +lj AND ll -> lm +jk LSHIFT 15 -> jo +iu RSHIFT 3 -> iw +NOT ii -> ij +1 AND cc -> cd +bn RSHIFT 3 -> bp +NOT gw -> gx +NOT ft -> fu +jn OR jo -> jp +iv OR jb -> jc +hv OR hu -> hw +19138 -> b +gj RSHIFT 5 -> gm +hq AND hs -> ht +dy RSHIFT 1 -> er +ao OR an -> ap +ld OR le -> lf +bk LSHIFT 1 -> ce +bz AND cb -> cc +bi LSHIFT 15 -> bm +il AND in -> io +af AND ah -> ai +as RSHIFT 1 -> bl +lf RSHIFT 3 -> lh +er OR es -> et +NOT ax -> ay +ci RSHIFT 1 -> db +et AND fe -> fg +lg OR lm -> ln +k AND m -> n +hz RSHIFT 2 -> ia +kh LSHIFT 1 -> lb +NOT ey -> ez +NOT di -> dj +dz OR ef -> eg +lx -> a +NOT iz -> ja +gz LSHIFT 15 -> hd +ce OR cd -> cf +fq AND fr -> ft +at AND az -> bb +ha OR gz -> hb +fp AND fv -> fx +NOT gb -> gc +ia AND ig -> ii +gl OR gm -> gn +0 -> c +NOT ca -> cb +bn RSHIFT 1 -> cg +c LSHIFT 1 -> t +iw OR ix -> iy +kg OR kf -> kh +dy OR ej -> ek +km AND kn -> kp +NOT fc -> fd +hz RSHIFT 3 -> ib +NOT dq -> dr +NOT fg -> fh +dy RSHIFT 2 -> dz +kk RSHIFT 2 -> kl +1 AND fi -> fj +NOT hr -> hs +jp RSHIFT 1 -> ki +bl OR bm -> bn +1 AND gy -> gz +gr AND gt -> gu +db OR dc -> dd +de OR dk -> dl +as RSHIFT 5 -> av +lf RSHIFT 5 -> li +hm AND ho -> hp +cg OR ch -> ci +gj AND gu -> gw +ge LSHIFT 15 -> gi +e OR f -> g +fp OR fv -> fw +fb AND fd -> fe +cd LSHIFT 15 -> ch +b RSHIFT 1 -> v +at OR az -> ba +bn RSHIFT 2 -> bo +lh AND li -> lk +dl AND dn -> do +eg AND ei -> ej +ex AND ez -> fa +NOT kp -> kq +NOT lk -> ll +x AND ai -> ak +jp OR ka -> kb +NOT jd -> je +iy AND ja -> jb +jp RSHIFT 3 -> jr +fo OR fz -> ga +df OR dg -> dh +gj RSHIFT 2 -> gk +gj OR gu -> gv +NOT jh -> ji +ap LSHIFT 1 -> bj +NOT ls -> lt +ir LSHIFT 1 -> jl +bn AND by -> ca +lv LSHIFT 15 -> lz +ba AND bc -> bd +cy LSHIFT 15 -> dc +ln AND lp -> lq +x RSHIFT 1 -> aq +gk OR gq -> gr +NOT kx -> ky +jg AND ji -> jj +bn OR by -> bz +fl LSHIFT 1 -> gf +bp OR bq -> br +he OR hp -> hq +et RSHIFT 5 -> ew +iu RSHIFT 2 -> iv +gl AND gm -> go +x OR ai -> aj +hc OR hd -> he +lg AND lm -> lo +lh OR li -> lj +da LSHIFT 1 -> du +fo RSHIFT 2 -> fp +gk AND gq -> gs +bj OR bi -> bk +lf OR lq -> lr +cj AND cp -> cr +hu LSHIFT 15 -> hy +1 AND bh -> bi +fo RSHIFT 3 -> fq +NOT lo -> lp +hw LSHIFT 1 -> iq +dd RSHIFT 1 -> dw +dt LSHIFT 15 -> dx +dy AND ej -> el +an LSHIFT 15 -> ar +aq OR ar -> as +1 AND r -> s +fw AND fy -> fz +NOT im -> in +et RSHIFT 3 -> ev +1 AND ds -> dt +ec AND ee -> ef +NOT ak -> al +jl OR jk -> jm +1 AND en -> eo +lb OR la -> lc +iu AND jf -> jh +iu RSHIFT 5 -> ix +bo AND bu -> bw +cz OR cy -> da +iv AND jb -> jd +iw AND ix -> iz +lf RSHIFT 1 -> ly +iu OR jf -> jg +NOT dm -> dn +lw OR lv -> lx +gg LSHIFT 1 -> ha +lr AND lt -> lu +fm OR fn -> fo +he RSHIFT 3 -> hg +aj AND al -> am +1 AND kz -> la +dy RSHIFT 5 -> eb +jc AND je -> jf +cm AND co -> cp +gv AND gx -> gy +ev OR ew -> ex +jp AND ka -> kc +fk OR fj -> fl +dy RSHIFT 3 -> ea +NOT bs -> bt +NOT ag -> ah +dz AND ef -> eh +cf LSHIFT 1 -> cz +NOT cv -> cw +1 AND cx -> cy +de AND dk -> dm +ck AND cl -> cn +x RSHIFT 5 -> aa +dv LSHIFT 1 -> ep +he RSHIFT 2 -> hf +NOT bw -> bx +ck OR cl -> cm +bp AND bq -> bs +as OR bd -> be +he AND hp -> hr +ev AND ew -> ey +1 AND lu -> lv +kk RSHIFT 3 -> km +b AND n -> p +NOT kc -> kd +lc LSHIFT 1 -> lw +km OR kn -> ko +id AND if -> ig +ih AND ij -> ik +jr AND js -> ju +ci RSHIFT 5 -> cl +hz RSHIFT 1 -> is +1 AND ke -> kf +NOT gs -> gt +aw AND ay -> az +x RSHIFT 2 -> y +ab AND ad -> ae +ff AND fh -> fi +ci AND ct -> cv +eq LSHIFT 1 -> fk +gj RSHIFT 3 -> gl +u LSHIFT 1 -> ao +NOT bb -> bc +NOT hj -> hk +kw AND ky -> kz +as AND bd -> bf +dw OR dx -> dy +br AND bt -> bu +kk AND kv -> kx +ep OR eo -> eq +he RSHIFT 1 -> hx +ki OR kj -> kk +NOT ju -> jv +ek AND em -> en +kk RSHIFT 5 -> kn +NOT eh -> ei +hx OR hy -> hz +ea OR eb -> ec +s LSHIFT 15 -> w +fo RSHIFT 1 -> gh +kk OR kv -> kw +bn RSHIFT 5 -> bq +NOT ed -> ee +1 AND ht -> hu +cu AND cw -> cx +b RSHIFT 5 -> f +kl AND kr -> kt +iq OR ip -> ir +ci RSHIFT 2 -> cj +cj OR cp -> cq +o AND q -> r +dd RSHIFT 5 -> dg +b RSHIFT 2 -> d +ks AND ku -> kv +b RSHIFT 3 -> e +d OR j -> k +NOT p -> q +NOT cr -> cs +du OR dt -> dv +kf LSHIFT 15 -> kj +NOT ac -> ad +fo RSHIFT 5 -> fr +hz OR ik -> il +jx AND jz -> ka +gh OR gi -> gj +kk RSHIFT 1 -> ld +hz RSHIFT 5 -> ic +as RSHIFT 2 -> at +NOT jy -> jz +1 AND am -> an +ci OR ct -> cu +hg AND hh -> hj +jq OR jw -> jx +v OR w -> x +la LSHIFT 15 -> le +dh AND dj -> dk +dp AND dr -> ds +jq AND jw -> jy +au OR av -> aw +NOT bf -> bg +z OR aa -> ab +ga AND gc -> gd +hz AND ik -> im +jt AND jv -> jw +z AND aa -> ac +jr OR js -> jt +hb LSHIFT 1 -> hv +hf OR hl -> hm +ib OR ic -> id +fq OR fr -> fs +cq AND cs -> ct +ia OR ig -> ih +dd OR do -> dp +d AND j -> l +ib AND ic -> ie +as RSHIFT 3 -> au +be AND bg -> bh +dd AND do -> dq +NOT l -> m +1 AND gd -> ge +y AND ae -> ag +fo AND fz -> gb +NOT ie -> if +e AND f -> h +x RSHIFT 3 -> z +y OR ae -> af +hf AND hl -> hn +NOT h -> i +NOT hn -> ho +he RSHIFT 5 -> hh \ No newline at end of file diff --git a/2015/day07/sample.day07 b/2015/day07/sample.day07 new file mode 100644 index 0000000..febb2a0 --- /dev/null +++ b/2015/day07/sample.day07 @@ -0,0 +1,8 @@ +123 -> x +456 -> y +x AND y -> d +x OR y -> e +x LSHIFT 2 -> f +y RSHIFT 2 -> g +NOT x -> h +NOT y -> i \ No newline at end of file diff --git a/2015/day08.py b/2015/day08.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day08.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day08/input.day08 b/2015/day08/input.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day08/sample.day08 b/2015/day08/sample.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day09.py b/2015/day09.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day09.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day09/input.day09 b/2015/day09/input.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day09/sample.day09 b/2015/day09/sample.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day10.py b/2015/day10.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day10.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day10/input.day10 b/2015/day10/input.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day10/sample.day10 b/2015/day10/sample.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day11.py b/2015/day11.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day11.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day11/input.day11 b/2015/day11/input.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day11/sample.day11 b/2015/day11/sample.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day12.py b/2015/day12.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day12.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day12/input.day12 b/2015/day12/input.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day12/sample.day12 b/2015/day12/sample.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day13.py b/2015/day13.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day13.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day13/input.day13 b/2015/day13/input.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day13/sample.day13 b/2015/day13/sample.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day14.py b/2015/day14.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day14.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day14/input.day14 b/2015/day14/input.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day14/sample.day14 b/2015/day14/sample.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day15.py b/2015/day15.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day15.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day15/input.day15 b/2015/day15/input.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day15/sample.day15 b/2015/day15/sample.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day16.py b/2015/day16.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day16.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day16/input.day16 b/2015/day16/input.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day16/sample.day16 b/2015/day16/sample.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day17.py b/2015/day17.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day17.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day17/input.day17 b/2015/day17/input.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day17/sample.day17 b/2015/day17/sample.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day18.py b/2015/day18.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day18.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day18/input.day18 b/2015/day18/input.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day18/sample.day18 b/2015/day18/sample.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day19.py b/2015/day19.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day19.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day19/input.day19 b/2015/day19/input.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day19/sample.day19 b/2015/day19/sample.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day20.py b/2015/day20.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day20.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day20/input.day20 b/2015/day20/input.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day20/sample.day20 b/2015/day20/sample.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day21.py b/2015/day21.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day21.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day21/input.day21 b/2015/day21/input.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day21/sample.day21 b/2015/day21/sample.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day22.py b/2015/day22.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day22.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day22/input.day22 b/2015/day22/input.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day22/sample.day22 b/2015/day22/sample.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day23.py b/2015/day23.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day23.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day23/input.day23 b/2015/day23/input.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day23/sample.day23 b/2015/day23/sample.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day24.py b/2015/day24.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day24.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day24/input.day24 b/2015/day24/input.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day24/sample.day24 b/2015/day24/sample.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day25.py b/2015/day25.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2015/day25.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2015/day25/input.day25 b/2015/day25/input.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2015/day25/sample.day25 b/2015/day25/sample.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2015/helpingFunctions.py b/2015/helpingFunctions.py new file mode 100644 index 0000000..5d2a60b --- /dev/null +++ b/2015/helpingFunctions.py @@ -0,0 +1,42 @@ +import sys, os + +sampleMode = False + +def identifyDay(inputArgument): + twoDigitsDay = '00' + day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'XX') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] + twoDigitsDay = str(day).zfill(2) + return twoDigitsDay + +def identifyYear(inputArgument): + inputArgument = inputArgument[:inputArgument.rfind('/')] + inputArgument = inputArgument[inputArgument.rfind('/')+1:] + year = int(inputArgument) if (inputArgument.isnumeric()) else 0 + fourDigitsYear = str(year).zfill(4) + return fourDigitsYear + +def setSampleMode(mode:bool): + global sampleMode + if (mode) : sampleMode = True + return + +def getSampleMode(): + return sampleMode + +def showSampleMode(): + if ( getSampleMode() ): + print ("----------------------") + print ("Running im Sample Mode") + print ("----------------------") + return + +def getPath2Data(aocDay,aocYear): + return './'+str(aocYear)+'/day'+str(aocDay)+'/' + +def getFilename2Data(aocDay): + dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'input.day'+str(aocDay) + return dataFilename + +def readDataFile (path, filename): + data = '' + return data \ No newline at end of file diff --git a/2022/day00.py b/2022/day00.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day00.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day00/input.day00 b/2022/day00/input.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day00/sample.day00 b/2022/day00/sample.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day01.py b/2022/day01.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day01.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day01/input.day01 b/2022/day01/input.day01 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day01/sample.day01 b/2022/day01/sample.day01 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day02.py b/2022/day02.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day02.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day02/input.day02 b/2022/day02/input.day02 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day02/sample.day02 b/2022/day02/sample.day02 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day03.py b/2022/day03.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day03.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day03/input.day03 b/2022/day03/input.day03 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day03/sample.day03 b/2022/day03/sample.day03 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day04.py b/2022/day04.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day04.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day04/input.day04 b/2022/day04/input.day04 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day04/sample.day04 b/2022/day04/sample.day04 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day05.py b/2022/day05.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day05.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day05/input.day05 b/2022/day05/input.day05 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day05/sample.day05 b/2022/day05/sample.day05 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day06.py b/2022/day06.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day06.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day06/input.day06 b/2022/day06/input.day06 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day06/sample.day06 b/2022/day06/sample.day06 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day07.py b/2022/day07.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day07.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day07/input.day07 b/2022/day07/input.day07 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day07/sample.day07 b/2022/day07/sample.day07 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day08.py b/2022/day08.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day08.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day08/input.day08 b/2022/day08/input.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day08/sample.day08 b/2022/day08/sample.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day09.py b/2022/day09.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day09.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day09/input.day09 b/2022/day09/input.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day09/sample.day09 b/2022/day09/sample.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day10.py b/2022/day10.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day10.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day10/input.day10 b/2022/day10/input.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day10/sample.day10 b/2022/day10/sample.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day11.py b/2022/day11.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day11.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day11/input.day11 b/2022/day11/input.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day11/sample.day11 b/2022/day11/sample.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day12.py b/2022/day12.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day12.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day12/input.day12 b/2022/day12/input.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day12/sample.day12 b/2022/day12/sample.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day13.py b/2022/day13.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day13.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day13/input.day13 b/2022/day13/input.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day13/sample.day13 b/2022/day13/sample.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day14.py b/2022/day14.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day14.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day14/input.day14 b/2022/day14/input.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day14/sample.day14 b/2022/day14/sample.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day15.py b/2022/day15.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day15.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day15/input.day15 b/2022/day15/input.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day15/sample.day15 b/2022/day15/sample.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day16.py b/2022/day16.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day16.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day16/input.day16 b/2022/day16/input.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day16/sample.day16 b/2022/day16/sample.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day17.py b/2022/day17.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day17.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day17/input.day17 b/2022/day17/input.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day17/sample.day17 b/2022/day17/sample.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day18.py b/2022/day18.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day18.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day18/input.day18 b/2022/day18/input.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day18/sample.day18 b/2022/day18/sample.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day19.py b/2022/day19.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day19.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day19/input.day19 b/2022/day19/input.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day19/sample.day19 b/2022/day19/sample.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day20.py b/2022/day20.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day20.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day20/input.day20 b/2022/day20/input.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day20/sample.day20 b/2022/day20/sample.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day21.py b/2022/day21.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day21.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day21/input.day21 b/2022/day21/input.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day21/sample.day21 b/2022/day21/sample.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day22.py b/2022/day22.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day22.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day22/input.day22 b/2022/day22/input.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day22/sample.day22 b/2022/day22/sample.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day23.py b/2022/day23.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day23.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day23/input.day23 b/2022/day23/input.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day23/sample.day23 b/2022/day23/sample.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day24.py b/2022/day24.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day24.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day24/input.day24 b/2022/day24/input.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day24/sample.day24 b/2022/day24/sample.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day25.py b/2022/day25.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2022/day25.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2022/day25/input.day25 b/2022/day25/input.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2022/day25/sample.day25 b/2022/day25/sample.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2022/helpingFunctions.py b/2022/helpingFunctions.py new file mode 100644 index 0000000..5d2a60b --- /dev/null +++ b/2022/helpingFunctions.py @@ -0,0 +1,42 @@ +import sys, os + +sampleMode = False + +def identifyDay(inputArgument): + twoDigitsDay = '00' + day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'XX') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] + twoDigitsDay = str(day).zfill(2) + return twoDigitsDay + +def identifyYear(inputArgument): + inputArgument = inputArgument[:inputArgument.rfind('/')] + inputArgument = inputArgument[inputArgument.rfind('/')+1:] + year = int(inputArgument) if (inputArgument.isnumeric()) else 0 + fourDigitsYear = str(year).zfill(4) + return fourDigitsYear + +def setSampleMode(mode:bool): + global sampleMode + if (mode) : sampleMode = True + return + +def getSampleMode(): + return sampleMode + +def showSampleMode(): + if ( getSampleMode() ): + print ("----------------------") + print ("Running im Sample Mode") + print ("----------------------") + return + +def getPath2Data(aocDay,aocYear): + return './'+str(aocYear)+'/day'+str(aocDay)+'/' + +def getFilename2Data(aocDay): + dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'input.day'+str(aocDay) + return dataFilename + +def readDataFile (path, filename): + data = '' + return data \ No newline at end of file diff --git a/2023/day00.py b/2023/day00.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day00.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day00/input.day00 b/2023/day00/input.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day00/sample.day00 b/2023/day00/sample.day00 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day01.py b/2023/day01.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day01.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day01/input.day01 b/2023/day01/input.day01 new file mode 100644 index 0000000..ccb4708 --- /dev/null +++ b/2023/day01/input.day01 @@ -0,0 +1,1000 @@ +qzjggk1one +two2seven7 +vszthreetwo6threethree4two3 +zcsvvlslqvfive11chhzmdjdgz8vbgldl +jjsmsksvbr77cfdrdseven1zd +947lkkgznlhxseventwo +8twohprsxmz47 +five11eight1 +seventhree1eightztszfourfivesix +cbcvd9 +hg91fourhhpvkrxbn +1mqbdkqxnine817four +btr4seventhree7hbkkg +4fivegtbqthreeeight421six +ninefivekd7 +9onetwofprmrhmonedb +threemtmjpfzqkdnlpl81one +six7eight5 +twonkhnine22fivep9two +qfqtkz9fivetst +rkzxrhvsgonerqqkpf7nined +fivezg8jmf6hrxnhgxxttwoneg +21nine9two2tfmfxjrvkznkjzs +rhcdx54 +jhnpkkp5seven +one8xrjsk9rrgkt +nine58 +1twohphpl +eight3pfzvrt9msgxtrbdclsix5 +874eighttcpzdbrlj +qlxkgtwo9 +ninedbvone1sixlnzdccpsixgzrfdnddmtgf +7eightppzmhmpn4bvvxp39sspf +four48rvhnzsnzmjxrl258 +342 +three2mmqxh391 +eight7vcmhfqznbccrvl4onehfqmjone1 +6kgchb4xggs75two +five6ntbssixvvtvs8spgdxl1six +one7one +27three2seven +rbmgfive4snq +four239threenineeightzrbvbgthree +two4one3 +sixcpcthzvczjp725 +fjninetwo6 +seventwonine7 +1twoonepzrjzsdfourdbdrxg1 +vzskvvbtjfeight2sltfdnine +oneeightfive3lthns49 +cxkqdgrftbhzsnine6 +onethreesixsix5jsj +43347two7 +threexfcvbv9qkthree3 +7qbpndqrzdzfjnineznpfrtkrjqthnkrpvcflfr +prcjmkhg9242eightjtcxmljchpchkkftqfk7 +four2bdhjzsfctwothree5 +1qkhgpms6two +foursixqgeight5b +8eightxtzp +21bcfkqgjndone +five56fivefiveg9six3 +seven1fivegrgcmp +prxgtm9threezfqsvpshjnrhbtthree +2eightsevenonenine2 +sevennine8vr +htssttpntwolpghms7dhqzpcssnqtwozxxj +4hggpthreefive +httwone6hhrvkknd +six2r828 +four42xhlgfour +8one8 +6twoseven8onextcj7zcl +lqx9848 +xdsvgtm8672sixsmlndlc2four +8vrvqdrcmx9 +one42nine +dstdftnine8three7 +hhpbcz3 +6tdzgbkdjmfourtworfmjnmlqs2three63 +5fivejbcjfqjnd34qcjkjvnnkrtwo86 +ztkbh8threezjfkcm2eight1six +gpkzlpfq4kghqlzqfkfivenine +gxnlcr6four92 +qoneight55five3 +brhzqvk6 +sevenlzvktjftcvfkvjzn6thlzf +2tnvkdzrtshfzxvzpc +mbndnhq3one9one2one3 +six11eightoneightklv +1lrtvfzszkqlcstmztkninenine14llmfive +1four69two8shhmd +five7xtvtlzpsfsz1htsjxzph5 +9seven4fcp +fqhbptgthdfnng6zzzksevenbchrtvtwo +two7712two +fdkbn4lhcfqcdjbfiveeight6 +foursjlrleight2five +nzfmprckbcdvnzzj4xcpngq6 +kczeightwo4fzshkzoneonesixfivegpnnrpsp +nine5fivethree +ninerjkcvrjr8koneseven23 +sncnb4gb9 +four3five21 +8seventwo +pknhg9jql51one4 +1threetwo6rfvsgjbhjlcfour +four7fiveseven3fourdqvsnkkdrbrhnfsx +7rcqcbqsfz766 +4hdzzzggfzs18eight2twoqmnlcxzxs +x8 +eightsixdqcpvsgzndqqone716three +6sixeightnsmkckmssfive12 +7threesixninejrbthreebqpqtl38 +five11nine9cljfjk83 +qhrgg313jjhzptpvnrjb +mm23 +onenineseventhreeseven5thxmgzlxm2 +threevhrfjnvv9sevenone +7onehnxssvbgeightsixone5 +sixone9sfsix +seven3five6nineleighttwo +6fiveeight3bxtt8 +tvtzseven3ljkqmnkprmsevenmdnpfour1 +twovjjnznn36fourpvjfourk +4zk2slkstxjxhr9 +6qzhhzgvpfoureightljcfxcjntwoseven +73p43cqqpjrsrmzgqzhtrl +32fivemxfdldrkrvstffive2 +fivethree3eight86 +six33rxgscqrpqtkjrqtwonet +3ssmlszjgtd8sixznrvstmbjqjthzkszx27pbsgkvsj +4eightnjvnvd57sixjtbrthmtlh +3eightsix28 +18mnrnlppvxdjg88 +qbnmt4fivepbqrlzkd7eight3twonehzh +5xkmvfive8two +72fourpbrsix48tg +8eighttwo28eight +68dvfxsix5trrftjmgsevenslnjvzggnine +zblphhsrhr2nine +7fivethree35ninet +sevensix1cmqgxjdpj3jqct2 +5fourtwogrpxkgxvtcfive1sevenjhxzb +oneseven9sixone5 +four4klsixnbkxmeightfourtwonekmc +2vzknhhhznx4one +kndone4three942lqxdxddfour +vrcmxdgssevenseventwothree9 +stxvhlsqb9jccxph8three38kbrxvkr +fjxhcbbczfmt7twoxfmdgxsps +5715threefgtsgrjb +254hnjrpsbbffxmvtjsjstkxkponeljcqhdll +qmvlxjjklmkhvmmjd7dfkztjvtnqfn +seven34five5mflmvnine6five +jtqdgkv3three +6four1fcmhbpmbknkpxthpcthreesevenonethree +three18frtwo +boneightvlgzbzrqzhrsfvsevenninenine8nqlzrcqslqxkn +7seven6sevenvrlnvqjdsix +hprgnr2hmgnjnvzleighttssseven42seven +fivethreevhscfxqrz42sixseventhreefour +9onettcqgvvgcpone +threeseven2sevenpxsjphvdzj51 +26onecmkcseven583six +nine3csevenpzhjxssxsix52 +2seveneightsixthree2 +7vxxfxjkfkeight69 +f3714fivedrzst +qvlrmrgdjsdsevenxjf1fournprtlbpngkqt +9four7rd549four +3xrnlfivehsnkzdgmfoursixninenine +two1onelkqgvceight +four7vbrkrcnine +twotwo8fshnvrzrhgksbf4two +1eighthdnrtpglhk6bfqtjqkgvcpztrf2 +93five6hrxc8six +onechldlktgq5xckxbtlhhszjmsjlsttxrncssffh4sccgxjz +fiveninenbkxzqtbqglx69 +xpkfldsggg3eightbqtbrfthd +1six1kk54sixnine5 +onethreefourfour99threethree +cbpgjltprj5 +seveneightfivezrsrseight9 +sevenbqpkone7six9 +2sixfour9fivehrksb2six +386mfggvhgksmnine1 +tlrkxpbnmmcjfzgbh697 +8bkksmcbnxsgzsixpv24 +four5qtjjcvnjnxfhcblfdgsssqmcqfive +3jppthreezkvjnxptwoonefourjtbxfllqf +sixtffm85ninefour +19seven +twocxxzkcv37kleightwod +dncbnpbch1sjjbdnfjqj +twosixjmljjllk67 +hggzqspzbllqeightzbckfllhtwoseven9 +tvsrsix9ninefivefour5twoneg +5eightwox +zvpkkrs734sj +88threekmzzbfsfxnrztbgkqseven5ltfcmzpxxvb +fivesix62twonine +xrcssevenp2 +seven6eightjkfqnrkntmgfgccrvjcninemsix8 +jcnnjbttlf7522fqxpcvd4sjq7 +dvqlsgd1szspcmfhmptnphk32five +93nqrmmbfbhvhkbjxcj6pzjb +4fourp +35522 +1462 +four5eightsevenxcqsevenqxxp +2pmthree +five73fivelkcfbxttlkxgqrq +7hcjtq +3c2 +stmtgdlxz9mm13mdkpn3fqmfnghmn +fivellbhrntmseven7vltvqrclblsxg +ninebrfbxcrsgxhmn61kndonegfbfrdseven +xbq5two9 +hrmsgltrlllrrnd3seven +fivexfs9 +6eightqvqdpxltsrldc6xrxjpdz14qxfnsvbzgj +sixfourfivershtwo9dfvnqkpzczpxgsfsgb2 +8sevenfive9twoonevmjcpklsvmsixbghd +sixgcdjdhgglhdv5 +dmxvdp62g6six +fsseven8fcqkl +6ninexkgqsglbninedcgtmsp4qhngtvs1 +62nine2threesix +m8rpxcjgcvtseven7five4 +kxx13 +plptcvbzh3fourfiveczxdrckjbg8twoninecrhfkll +8six8 +xlvngzxlrnhh3fiverf3 +vk3eight78 +eightone97six3jdztsg +4mmdsmdllrkld +twotdnlkbdqmqtwo1foursevenxbbtrfjztbthree +fivetzszgzbvtwoone6 +snine52bmvkdkeight9 +fourponelvrncjhkmv5 +onexvnine2xtjkjvmhpvkzrzczthree3two +5xbdg5klzcxxfsix +seveneight17 +gnxptlnhfr32 +vcnfhslqb1nine +sixfour7oneights +sninefour9three +ddhmpjnnchkkc1hlb +mzvsgpbp21four468 +four8s3kfqhlxfeightkjbfv +83threexgsvhrnvfive +dhqtdfcl4sbvthreeckqr +1nineptcsbtckgrgeightjjcn82xtkzmjhnsb +bprldcvpqx94onezmcgntk6 +816 +sixone9nineeightclrvctwojfjskplgtx +twofourpqkvbs8kgtdrsqd +hgqxn9psdeightpmpqtrzpncxx +lvk1nine9 +twothree7eightqqhzbhbmntpknmnvckfourhbsdqlzs +nine61one +759fkfnzgjkhvztssv39 +gfhnrfone16eight +threepqxzpeighttwoseventgvjvgl1 +dgthhx1 +shdffcqfxpvpfsv4hmknbfnvmt5seven +sixsevenkgdvdqbp7tfqjpjfive4 +ngvqc6three88nlnhzjndss7two +sroneight8 +77seven114sixgzrnlh6 +8fourfive7two1 +nccsjq6twothree14vzjnnrjbxjhkdcvmvzzc +six4hxrjdztttqssvhslpqjlxtqhgtqf +five4dlmdtsdxrg73one8eight +1sevensevenhb +vbnmfr3knfncgtseven +8sceightnine +x3two +hjhknjmbhnpsl1six2six5 +ninenine4b74eightthreefive +twofive5fhnnsq32mdflndlft7 +threesix7 +sixfivefivesixthreeseven84 +ghzgpxjqj4threeone2153 +3threefive5 +four5one59fivesevenzlpgnmjtqh +47jznslzfdgklndmpcjdksrqfg4threefourgctxp +kjk9pxsdgsheight6 +four6mbskcnpgkb +48nine +3ninekncjthtk9rbnmdmdrhrksevenpcpnnk +jgqqvd71twoqmzr +fr8six93nine3 +29sevenppgrb3pqbbrthreeseven +onetwo3fivethree +2nineninefourpstb72 +one6two +971 +nine4foureight1dsftjdrq +msgbxbbtb3pnlnjsixthreefoureightwobm +69mqfclsqhss +one166eightbtchdlppone +zpg29lnksjlsxqmtwo1k +76ninetwo56 +fourbpmgdl38qmnfrlntxzthree7 +jjxvqchjzscxq1vfmjvklg +psixseven57 +qxgqsfhf54 +zcjshnthree45hhpdfninevhrlhzxthree +sgkztgmsbs7ndtvpm8twofive7 +ntwonemktccptwotwoseven4one +2sixnine4nine +onelzjlkttzqthree34threethreeeighthrfzgzzbr +2eightxktjp6tmlrlmkpbcz +four974 +9ngnj +7fjrh9 +2fxpcdjcnm1two +ninerpbnjfbfourtwoone61lndjmzqfrj +8vklltm1pthreedtp +onemfmhgfjcbptwosix31 +lrzvkvvffvlfjgzcxgqpf769fvppsmfivegktg +five7sevennine +6vjcfhkf2bgjknzlfour +nine7eightwoczx +gccdbvjlzeightfour4fcvxdqg +hsvjdlhqxmq1575two +8rtlptb5xjptxk +4seven3hcpnqhzz3xxkjzltgjmpnmthree +threejlsninefour12 +bg915kmgdfzmqp4 +four2lsix8zjhmkq +tmjtwonesevenktwophvrsqpntwobg9 +ht8fhqqsvzpg12 +fgbd11eight7486 +vzrtrfiveoneeightsixseven8xdklgqj +ninejg34 +2zlrpcf +318fbtmxdlnbr7sngkjbzt +hgneightwogrfkcxpthree98threefourxshxvpbone +ninesix6onekzffggjtvh3ninethree +5vn +7dctbvpm +cvvpszdheight6 +sjtlseven42threemsdfnfive +km6zcxpzlhmd +3sixbfs +clkpxpmtrthree4one +bthreethree42eightqzjfnc +v955onezltllqmk +vrqkjpr1rkjmljn1fourninezpkfvvqsldxzlnl +sixnfivetchsccgr5s7fourgnsxqg +hqkgndxmdthree5npf76seven +six7grnnxhgg4 +jthree432mvppjpbk2vcrnthzzc +9seventwo48jpvvkgf +86jhtmsftsmkxpjgjvdqjchpmt +kmpqfnvstncrxq3hpbk +hfbknxzrmqlzsdk79 +jxdlfivemplvrsl9eight +931 +hcfssghtwonsjcdhbnfx42 +49sixeight +vpc2eight7two +3sixlqdzbf2nine54five +twoone92threenphjgdlztslfourvlfpbdqpvh +eight1347eightdhfdqnp +3fiveone761 +9hbgljt +sixlfivet9qtsvhlfour +six35two +2one3vhzfxjp68 +seventnqpllcxcxbzkznqs24 +1twoeightsix +five2sixnine975ffjtdslzvhmgzxmjp +four53eight +6fivesevensixbnpbqvfvkc91kkcth +4hdfvjblpmhhgvssmzhgtspjc +xtftqpvbfbzlgmrrvmctwo4cqhrdsqjnjone +hbqllzxhz5t +qrxoneight3sixlcsldhone +hjdsevenqffone5threeljqpdxxxs +one79hdbrttptvpfoursix9seven +ninetwoczt18threenine4vlcrcnmxr +h9fourseven8kbbfkxpmfll +ztrqpd88fjfive +1onetwoxprmpthreevbjmjzqgcms1one +9qgpzftfq +lpsninevdxdxpfbbm2 +41hdnzrrv7 +vhdbnkjhxbsmsix5zppbcrhhv +fourlnfive19 +threedjjkssbhsevensevenfive8vzsrprh3fcnlz +zkgp95znpqjdgtsclscf6 +9z3 +fnrkmtkz4 +sixfour1qpzzzrtcneight +67kseven +4lrqrhone +vxqtbgltwosptqhznnine7 +1tqcxmxhtdljmsklfzfb9 +eight2mqcmcxqzdjnpddqjptwocznvhzone +g7 +1gzmnlvrmlfscdbnine +18qjtq6nine +three9six85four +vrhfclpzteightdvjdsjhseventhree2 +bblhvdcjfqgfive6ninenine7 +8nrjbqnfkfiveqhbbc7lfjhsfour7 +cjkphrvninefour2nine6 +kscvmlxssevenonelqdrtcqcqthree3two4 +1333 +sfrzr9 +onez2eight7 +tbsxcmgmnb636nfcdsbj +2vvqhrczfnmngbpgtsnlfourfiveqzk +7gsskljk6bmgstmptsixcdjzm61jzgxbjrtl +fourvfph31 +tpzfive8 +fiveseven62 +six55sevenvrxdeightnine4 +pffbhkpvhtmsr3 +4eightninemzbkzmkd +jntwo4twofdgrl3fgtqmnfnz +6threetvzjn8 +5kvc82tksgsxvm +mrtwone3seventhree +8six7gxgfmpkheightxxqbshrn +fivevtbcgzmvrdkxnssneight2three +fiveseven2ndpkqtxxkninesix +one7jslcxd +7vfjpjfsxgcfbgtsbcnfjfvdql +35ninexmssjbzvflcsgjlgf4 +jfnknfxsrp6hpmnclmone6hzpnfnbhsfive9 +jhmmvkspvdltqcmqlqmbsevengsvfvxhct7vnjntseven +lzml9ninerbnpl3ltsclmjvfour +fourpzsbmv2oneeightseven +fourcptgpkm5onepkbpbmzhsnbftflkthreeznnjkrmqkp +vflqthspgjrxnvvone9fourfour +two4jtcqdrbmfs2six +1five2seven +seveneight8threerspnbsxhjkeightnblhlj +cxnhsl6three +eight96nineone1oneone +twotwo5ffngqkkjc +sixnine9ptxjjbhhpxmxllvd +69tkdpg +tgrtrd4 +7xj99 +6kjgvlfivedfourseven +sixjvbqzs9 +1336threeseven +3mzfgkcgrkm668 +eight639five +zzg25s2mccdfrfsthreeklsqnbgpzbjmgqlntc +np9twofive57four +nrkxxt9mbxfnbrjvfzf +55gfl +five4ninepnpdrfqonepblsnm1 +2svkthgrhgrkjjvcxxgjjlnm +3758rn6 +rghbnfjdz6kj +brnfvpdxrkhfsql216seven +xchkrlrn5rqfcgznxjnfour4hpb +three658 +72sevensix +6four569rmcnhcqb6three +fourfoursix8eightqkpvbns2 +sixh6fourfive +465 +8oneightmx +dkdnrtqxhx6 +m13oneonethreeldjsbrrvbg +5tqvlxnfournddkxcfchr3 +ninefive418lfgb32 +cfjbm18 +eight6jdgnxxmgg +boneight2seven1 +vltwone3eight2one +five1xf1foursix +ninecgznbgcrfseven8hkqtwo +vttwone6tjnftjsmkb +sixdfthkdcq84chsrtwofdjm +hgtvtqbgchlntttzht34twojpjzqh17 +6qqpsnkdscgzvplqpdqkbmtv +eightjbone3cpfvrrpvjeight +9twondldz +974 +2jtnd7oneccdhldpghxjp +54fkqhzjgssixtkhvtmkggtpgpn +four7twosixninelmmhzttthtprgd +qkjtzllg7mhvhrdmhlvcjxkqlvplfeightk +xcndxmmqnj6bzhkx +m9one +nzcdtnk8one +onesevenvspvtnlx829one +32fbfbpblxjlsn +7tkgxjdk598xbkxzbt1xqgzppfcrh +zbffthreexqgtzpeight11csbcvrdsdnjxrf +twonine6sixnine +sqlzbx8llrvtzmgdjfrtvjxctp +5nine95nineonethree8 +three814fourb5eight +tcgrxfxjqthreemdzj1 +kpfbjlftxzcvqjmbtbjhzsnhknlcrdntseven8 +8572xrjm9bzrnzz +klkdgszqphbdt4 +seven69 +nineseventwosixseven6fourone +hkmhpdlxrxtbljnlq6twovszpngfdx5dpktd +nfcxsr5eight63one +8eighttwonine5five7eightwokv +4nkv +6klbcjh9rnhvrznrtvkktnhone +597twoseven +xlrfzngpffhjc18 +nine57seven3xfhs +377 +fivefourcxdfgbtnhmscdlsrnnljvgjlthree1f +4hsgqrzthtk +3ninez24 +k9qgqsbbqdsj44tr +djcsxdmd6jrgtmxpk5onegrljnflbhmnnx +sxxrhpkpclbjms3jq +8ngmpfiveoneninerpbscdgjxztkzldcjbrk +637zbrfpsvhj2hzmvx +4eight6chc6 +5one9nine +7sevengqrqztfvmhkqnjveightl2twovtgdlhv +twosixeighteightmm62 +zlbtcjgninevbctrmsqkqkkjmvcfthnfvnl4 +fivesjmgr7two +twotwofivexmsqvjv6four +7fiveeightsixnine +ptkdvqjbniner3five6 +68threepkzgtdhmmznine +5jhmzcznnppzpzvmtmn +onethree2nine +9six9 +fivek4qhqpdd +ninexqrfqddhsix96eight +one1nxzzlj +four6gjkhkmqvq3jn +6scthreedtsqfzdjdpb614 +77tqrbpsrkvvf +7ncjgtb854 +threeggknmtwofour9kjlnfkhfive +t5trbxmkss17qvbdbl +jjftkk5 +xqkxrsevennrlqqmcdtwo6srsxdmqffx +3six4 +bssbzmgdvs9qnsfznvone8seventfx4 +fiveckftrzxhmtwobrlgzeightkscfxzqqvm3five +pngggbvtpsfkjcnine18one +zkgg9sevensixhlxb3 +gxxgrmqfbrsvm3xdpzqzhjthreefivemz +9sixshcpfivetblntkvqrfcrqbgxcvgzxdq4 +1prnmqrteight9three6twozvbmhttzqzhjmxxg +191mjpnddq +4gtddmzprpvgrgbczcxbz +2onesevensixbmsmstbqeight9dxtjkndsz +mtwoneeightmdseventwo24qn +two69bmvplcfhgxqxzbnb32 +282seventwo1582 +19cmqgjn +8ninesxkxtjbmsssevenmtwoptlsx3 +5ninefourpc68eightonefour +nineoneseven3four7 +83fivevlndzxsix4njnine +4ninengdkgtt4eight +threenine1 +461q583 +37mtppzmdtonedfrgxxr +dbkqbcpgjgonejbrsdvgfmgftwo8 +four52bnine6 +17 +9mmjzvlgnk6 +1three3twonett +123threesixklzxonesix +two5ninebcsrkvldtkfseventx14oneightt +eightscsbpjfvzqqzvphgqb5fivermgpnztwo +zlvgbkztbzbbrfive9jqp +eightphzrnbdxshhhkvtv8 +mqbqlznsr6 +87twobrcxzxgrjqs97pskfour +fivecthreekfrmsjvcmlbrcjxjf8four +vgscjjrxtwo6llhdnsevenpb +jrkrbndlphnnfvstthree6ninespchtjzht +flcffqpthznrhmxklztqtdqhone2 +2811fourseveneighttwokqsfzvgn +8nvrdhmlnrjqsixpjdbrfrp +thnpqfntttmbbjeightfourxgcone4 +5leightkvsjfjttxlrpnmjxzxsevenlhc +eightqrqvtcclqfive42 +5threesix +qrpfive2mlhgctblhns6sixglnllttvdtwonekls +6six8two +4fourninerrppmzxlfdsixbzvdjljsx4 +rjfpktwo7nndlnmsixxtbngv +lpgfs9eight12krtktzsix9four +3one1x +pjnvpbbb3 +5nine1ninejxccxrrcdf4 +gdnmpnineldhxrtpxbfn8zkmcpgpz4 +r821sixxktbpncp +7glxnlfrvlqgkfour +8three28 +fourtwo3twopllxrjtcthree4 +txhrhxpbg6 +psfrrdvdglrgb9 +nfjnshb4seven764xmrkhfgpgtsmsix +2vflvfgkcktqlqrktkx3eight8h +hmzhxctkv8tftvzxkoneightdb +cnklbqdseven6kdrvbjthreeone48fiveeightwoj +sevenfouronetwo5323 +tworpfmhd12 +tlconeightjcktcngts1eightmxnsd6qgzlvrg22 +klrpbs2jxmfdhnzmbtwoqmjfive +mdzptfm94mqlscksrmh +spkzfm9six2zjgmpbm1vlktblxqnn +blfxjrrcjx4four84xb6 +bbsbpgskffourrfbhgblhvxlhxbms3 +lhgtjmone6878 +qvlvtwosevenxchqcfivefjbgvgstptbv5 +eightff6fhl6 +three3vsix1dxtmtwo +79vrsng6eightnblbrhkbk63 +nineqlxxvpxvzgsdhsix6 +kpjsvdlrfg2drhmqtthreenineseven9six +3nlrkddlvlslnrms +8b3foursixrjrd +7gpjclsfljhnndseven2twonine +cxxtx79onetwokgdbh +bfllxk5t +42fivefivemtcnmftwom +dsrfcc2rjb1nknjlfone +1onethreejnrgmfzbeight277 +rxhrjb189nine +onegd6threeone +spcrbvcdgkgtkeight4fourj2ninekfjg +leightwo54dgvslxlmr49drfcpkxglt +fv72xkkqltqfour +one95gcspknineonejbxeightsix +7onetwothree47 +twotwo8 +9pprfftptwok +two85 +cppthree136ljvgmzjsix +twoppqninejtjlnzveight2 +4mdnrggvjq7jxst59 +twotwoone6xjsxdtmpvl +six4flbq +seven3three4jskfivesix3zjbnktkb +fourzzg8four31twogrsbjmhdj +hrbcmsqq2sixsix +one87fourtwoqshfntzqmfourfdkg2 +8sixsevenfjsgxeightoneseven6 +sixgkmhdprrsdcnrp6 +rfleightwo7ctrrfourjszmgsbxdsevenfive48 +fpcktkstbxclhttfmdjmqgspbdpt5six +six3stptnfbrnrfivekxntrsnnrf +qqnmvdnp7nine9bnkqkxglk5 +fninepczvnine6 +fivesixthree1foursevendvsdrlrxnjsnlbchs +ninetwo4eightnine +fiveninepcsdhmvtvrzvctd5gcshznfsppbphhtcpeightwob +4jmlqvvrndnine8n9 +six8tjgm2vnine +nbf1zqdfrddsfsseven1sixznpcfour +1nine8gj78vhphqf8five +3sixonegthreeninepc18 +gsznrcseven4 +927four13h +rvzdfpgbdztvhd4two +seven4qnr +six1eight +9lkkb +3seven92ntrbtjggtrcrnffst +xhcpcdmfl5 +fiverpngvmzbxrqbtv49qhctgpcmlmbqhzsix +sevensix82fivexhrdfgrbdpp7 +lkloneighttwo4dfour8eight +four2threen2mpcqmfourrspvlbeightwobb +scqg125htncplb +32shmcone31fourxn +3583 +four5zzfphtvjrmmfgfzq4 +1one9one +nine9fourmvcfshnbonesevengxlhlmvghsltxhxzg +65hlhzm4brnine +jkkpthree6 +zpjkstn72rjjskdcgtwo4three2 +gvz73fourjzzbxmf6 +662nqsjsxzf7threesix +three9sixfive8pxdktmlqgchrfpdjpdv7four +19hsvtrpngkqvtrgcntbeightwovfp +zsgeightwo92foursevenonefive +fourthreexcztqhqtmd1sxzqtlhkvnmhcrgthree +dthftwocsnkrjrkkeight8oneqzfxfrxh +36414lxhkhtm +cqjxdlx9two578npkbx +2nine7eightvn8hzcxscgrm +seven3shxcpfdzhmnine6eightp85 +pmjfklprvxmfbgthreeeightpkdnskthrkmjmdnpgztqllbrdvt8 +7kdrjsrhxljmvqdrdgtcbone636fourone +892 +83jkvnxmcsixseven25csxd +13zzrplcqhxktbxkpkhdgb +cgclnmkl9 +twotwo1eight +seven23361 +72onepmvnzbnjnhv3seven9 +threeqmxcpvmhbpvtlvcponedlpcvlqhthree2 +vjszmfour69scgz +ldlqdbsxb2kzpq +four77threeone1 +lglpdjdjrl8seven9 +63nineeight +xgg9xhthjft5 +qzgk7sixlhc3sixzkqlrhsixnfl +7fourjpmhfclbklmqj +twofive7twothreercdqdjx +2clvxxknzjdsevensixllczroneqxrqm +mcdghvnbvdmqtbnbbvm8sxdpztffkkl +17seven +gj4seven74 +pdkhqcrkkpshxgxbxbq3vsevenvpgxggk +1six7onelhvfffpdkgpgggrk +46jtwonen +4eightsix6hscxf +j8gs5seven +4qntv5two3 +pflzqzrxkfive5fourninefrpp9six +seven18 +6eighteightthreeeightjltcgqfpttwo +eight6five +tmz9 +jpseven4 +smnpnlvcfqsdjhs94 +pmsseven7prmvp +nkdeighthxxbbvptwoonefive4one +zst7cxhnlbgcqfive77xmknmnjcdcbkbrctdj +eightsixjsevenplzkx34jfctccmdbt +kmkzsixthree84 +tjpn5xzrktqhlpmeight +vxp6onetwofourfive +meightwoninesevenzdtltdseven7pcgkqgcpsjbbqlseven1 +two28tnkxzldhfour6tbtctxsjone +2sevenmkmcrlkhfivertcknzkrtwo6 +rthree3seven +1fivebxkhzcdxsixqxldjmhhmlfivehhscj +sixeight2vjfsgrrpqkrkbxmqcntq3eight +fbpsgsgnpthreeb5two4 +9fxqxkrrs1qcqct +lg4onetwodkgd9 +njszseven55foursix +sevenone8 +four8sixvrtzgzbhgone2 +threeonetwo227 +tbfourrkmclvrjzd2bvf6 +27ttkxsqr +xzjf8sixrxdzzn +9qtmt6eightsvtcmtkcqcqsxfn9jtpzr +twodhmprpfvcfour747 +375jrn +cpvdponeklkpmsqslq9 +ttzvkqrjsqgbztzqrvk7ldthree35djbdgh +9lcfxtftnhseven1nine +6bthreecfptdcfsf65 +eightnine6nrrpsbqgggflnp91 +mslqqsnjlhqdffndcnlcttjmfeightfive8nine +kvfkrt7pkthreethreegt +ninez45fourf +fivefourlscfour1fbpone +8zqdqtzt6bv1fourtwo +lzszbvchjdgz93nine +mtflpsmqm74two8 +7sjqprggnzone1 +2ncl5gzvnrtgfgp6fourjrbnnmpmhthree +pbfxkfsone5qnlvplzseven4 +gkzmtz5jgsldqgl7mtbft4lkmkpvkfive +7lskftknzrtninexthhsnljms +vzrlnsjqz8531three272 +seven18bbnd +1hqmvhfbgff9nhlbfpqlsf +four2eightseven +fournine4gzjjfgdd +four34rlcmzmzhdmn +knprzpv5four9onetwonineeight +eightrtqcdnsgbbcxgzqtkscbpvnjzs49three +threethree82onezbqjzfxrqkkz8 +6vtqkkf +eightsix73 +42446eightsixsix +11threesix +5ninenine7seventhree +43seveneight58six2eight +szclshzxqq3 +29hsl21threevx5 +gbxpeight1 +7two7four7six +7hcnfclhcfk5 +fiveninen5five4 +eight11threethreeeight +62lbhqrzbblz +8four6 +seveneight8six4 +hlknnfkqfive6one9 +nmeight8 +two98zsevennpjsllnpbkd +4t +j94662seven +two8one96fivenineqd +7seven7nine9s +nineninepgbbrxsdfzsfkrmsjmdrc6khkghxtjcmcjsrk +bqppgvgfour8onedlkzjkfzsbnksixnine +82twojxlgvlrvlmone +mhjh4fttnqjkcteight6eight1blqbn5 +14bprmfvssfqnine18 +threesixmzsbjdkzrgseventwosix89j +1knlhqgvprseven39 +5oneseven +mctqcpseven1msrtlkdtwo2 +2threetwog3jdvxvxmrjtwo +twotccrchvh9fnxfouronefive6 +hdldjzkj26 +43kxqcjpkbczcxcfr4nrfpxxnp +mmxvfrpfive3 +lcvslljqsss5six84seven +84nine2sevenfivezd3 +5ninefxhdvthqninehzksqfgrgtone16 +three5533fivexqfm +5fourfive4 +fourldkdvvnrbrseven73mngqjf +bpsix4ninetzscrgq +jbeightwoninemsfcfzrsqtwop5eight69five +sixeightfourgthreegg8 +6twonine8fourvdtk +1fivethreetscbjltkmpkjrkbssxnhnsks3 +rpcgsqtxqvtwoonetwo4four +one7one3fzmfivethree +mkqzfhhxfive7 +sixsix5oneeightsix +l9fourfq +n6seven61eightfoursbcxl +six5gk +nfthreefour88 +four265sevenknmlxdxmqpsszznrz +1gqbjbhmghgqdjxxppfhtlnine +bvhvvhmq3fivethree3sixmfgf +vqgnqspseven66qlbgtzqjdxxxjmxmqr +4sevenfive6nine45 +htxpdcjfbfour5939mnhqsqcvn +qvqgppfvrktjncgkfshzvhcxfzvtvgtwo37two +foursixzsgx8eight +knxqh1jfskmzqfone +zxq998521jnpcvhll +3fivebsonefournine2eight1 +kcbcvone6six +four65fourlgzxone +dclkbndljtxrmltrbznine5 +bd1qjqhlgftrgsevensevenseven2sglrmx +grpdgfourpjzfourone75qtknl +nine66 +twomxqflmbjg7 +foursix2threeseven +36three2hvmgbqd +two8vlqnpone3oneninesix +5nine3r9 +sevenvpcjqtnzdpcscgrgdmghqhpgkninebvbpcv5six1 +fivemrzsixpzxvrpseven3rseven1 +vqlrmnxnpvlpmeightzmvthgc43 +pvttbbzvhfourninekptxsix8three93 +hdpkd2h77fourtsjlqp +kgnrsfrmt3tddtzxcdlheight53dfk +z1rqjkp +8prcvdbhvpl4three +rgmtnbmsf9threenfz8 +fivesvdn9seven7one99 +seven6tnqqkpzj +threeseven9 +1kkjfsgfmseventhree +ninesixlqpkvhzntwo6two8bplfhg +25tx7seven5 +14vrsdbpftdxfivefivefourtjdmgvblmfjjdjd6 +5pntcmsixfivesix4 +sixsixvcnzxbxkfour1fiveeight +spjrlfppdsixnvr3tlxcjvtgbjqrszvxv +9five9gnrqdhbhbbsj +sevenjqgdmdzsix4pzplgfzlmltllk1 +nmjdzlseven24one8pqqfsrkhb53 +seven1four +1gfbqptlvmzgvqrhtthreesevenrxjdslrfdzhx +ddnine5 +zbqrvctj5 +seven354ftrznzcqx41eight3eightwonsj +three989pvsqhhzvxnine +ktoneight477mkhkjzsbvninefjfive4 +85foursixsix +8bcnkh3tcqhneightktlpdmzpjdksjpfoneightqm +eight68dlvgjb8bbchjlxzvf +nine1nzcdvfgm +1eight1sdjnfpq +htninefiveeighteight8 +gtwo5 +9fournhpb33 +mqxsfjfive6nine2 +gchkthf2 +vkd6pmvhbbphtfsjpllvkp +llrfcqczjldmlvvrxeightnvjgkqblgj7six +nine2qb +pqknhcqr54onefourfive2 +qthree58 +9dnkqgjeighttcbbctlgdf +8fv5 +8fp5xghphxrq6fourbfninefive +nine9sixkqdhvpqeight +qzssjfkv8nrlnx26 +413rqbqmqlprthree8br +jzlsrkcsrlfkccslrfrgnq147plpcxrtwo +7twosixone6threedcct6 +zhhhr55 +5jjzqlpjm +ninetwo1 +kskmzfhscm4one +zdrjcmlxcx4mtvsltkm711bncbfnc3ngkhvzt +1six9 +3sixtwo9 +xqvsixonexdkvxpkpqhlrone93 +7sevenonevxlcgsfjgbjfztjxjljnbmb5prh +6zbrlxhxr1fourfivegfhnjscnine +5gzeight +twofourbsix17 +fcrzbninenine3 +qpksmzv5 +8kjkmvrggzglpmnnzcmthree +gjbfour7five +eight4eightnine +1onekbsjqjjhtwo +4zxrtfz +jcjlqxfbnvghf1 +two2seventhreeninefive +6twoclrbkh6nine4 +mnrrtf2fiveseven9xlflf +42drsxctvqsix +2six71sixfourtwo +5seven2eight +fhtsxjjnztwovqmxqtlxd1 +ttxqr9481 +6five8sevenfour2 +mjmlgn7seven5 +threefive4dzlkfone19ndpxxzjz5 +ggpdsnrqtxxt1hpshzkpfhb +91jdrmgzt68pnf +mdtmqvtz9sevenx8twoner +sckzbprzktwonine31bkmtbhmcs +fgvjgx5one7hctftvmbvk +fjlxdhqxn6ninetwoxthcbhmxnine9zzcfqbsxqk +43fourthreesjldzsonesix3ndm +8twofivexpvdjljffpcnbjtkninefive +hfbcbhbxgzjqjspxlpnbppjsfcvqvkgxd22 +ninezzrg4 +4hfkdjkgdfsix +5onefive2 +94crrdpjlzztjb6 +sixktcznlmccmb8 +hgpxpvphr589d +mvsqtsks2772flfkgzd +7ninefivesvglcxk +2knkmjqkpt8gfzvklcpseven7five +two1onetwothree +three3sevenmdhvb +jrmzfnvvhbfour297 +ninebkcpfkzdone1 +11eighteightkdmmzth +8bnhlskcvtrnpf43jcfhfxf +134geight +5kfmjnseven3two3 +seven3four4onebdzznjngqbqg +fpxmmbthreeninethreefour3six +9twoz83jxjt +dnpqsmzvlzsppf46 +five8onexsgnxtdtwonecl +8gpbddqqpnq1onetxmhshjdpmnine +dhqft2three8twosixppsdxrxrzfb +1xjnzbspfournseven +cjcfkzfive45zjkrlvnz8 +sixrzmqrkkd5fqqf +sixkxtpcjmrmvvqjdgfttd6 +threehpbsevenffnqgdjcftjkdjhhk7dvzmkmqthreefflb +6npp7fivebghnnxnqjxhhxfdqpsixfour +ffour87fqrvqxqlqrrk +6ninerzksfbszmqnvgmtqonesixjzsf +sevenszl3lkqqfhlrdmkxgggvmkb +5c1 +vrxbfckfz7qlfrnggsbdfive6glhk62three +7eightfiveeightrdnhfnqeight5 +5threethreerdlsfdsvggzbonecxqzqdvxcqtqbg1 +gttsix2567 \ No newline at end of file diff --git a/2023/day01/sample.day01 b/2023/day01/sample.day01 new file mode 100644 index 0000000..4316a6b --- /dev/null +++ b/2023/day01/sample.day01 @@ -0,0 +1,7 @@ +two1nine +eightwothree +abcone2threexyz +xtwone3four +4nineeightseven2 +zoneight234 +7pqrstsixteen \ No newline at end of file diff --git a/2023/day02.py b/2023/day02.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day02.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day02/input.day02 b/2023/day02/input.day02 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day02/sample.day02 b/2023/day02/sample.day02 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day03.py b/2023/day03.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day03.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day03/input.day03 b/2023/day03/input.day03 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day03/sample.day03 b/2023/day03/sample.day03 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day04.py b/2023/day04.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day04.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day04/input.day04 b/2023/day04/input.day04 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day04/sample.day04 b/2023/day04/sample.day04 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day05.py b/2023/day05.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day05.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day05/input.day05 b/2023/day05/input.day05 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day05/sample.day05 b/2023/day05/sample.day05 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day06.py b/2023/day06.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day06.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day06/input.day06 b/2023/day06/input.day06 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day06/sample.day06 b/2023/day06/sample.day06 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day07.py b/2023/day07.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day07.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day07/input.day07 b/2023/day07/input.day07 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day07/sample.day07 b/2023/day07/sample.day07 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day08.py b/2023/day08.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day08.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day08/input.day08 b/2023/day08/input.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day08/sample.day08 b/2023/day08/sample.day08 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day09.py b/2023/day09.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day09.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day09/input.day09 b/2023/day09/input.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day09/sample.day09 b/2023/day09/sample.day09 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day10.py b/2023/day10.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day10.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day10/input.day10 b/2023/day10/input.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day10/sample.day10 b/2023/day10/sample.day10 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day11.py b/2023/day11.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day11.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day11/input.day11 b/2023/day11/input.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day11/sample.day11 b/2023/day11/sample.day11 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day12.py b/2023/day12.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day12.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day12/input.day12 b/2023/day12/input.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day12/sample.day12 b/2023/day12/sample.day12 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day13.py b/2023/day13.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day13.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day13/input.day13 b/2023/day13/input.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day13/sample.day13 b/2023/day13/sample.day13 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day14.py b/2023/day14.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day14.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day14/input.day14 b/2023/day14/input.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day14/sample.day14 b/2023/day14/sample.day14 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day15.py b/2023/day15.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day15.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day15/input.day15 b/2023/day15/input.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day15/sample.day15 b/2023/day15/sample.day15 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day16.py b/2023/day16.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day16.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day16/input.day16 b/2023/day16/input.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day16/sample.day16 b/2023/day16/sample.day16 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day17.py b/2023/day17.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day17.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day17/input.day17 b/2023/day17/input.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day17/sample.day17 b/2023/day17/sample.day17 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day18.py b/2023/day18.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day18.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day18/input.day18 b/2023/day18/input.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day18/sample.day18 b/2023/day18/sample.day18 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day19.py b/2023/day19.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day19.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day19/input.day19 b/2023/day19/input.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day19/sample.day19 b/2023/day19/sample.day19 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day20.py b/2023/day20.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day20.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day20/input.day20 b/2023/day20/input.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day20/sample.day20 b/2023/day20/sample.day20 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day21.py b/2023/day21.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day21.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day21/input.day21 b/2023/day21/input.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day21/sample.day21 b/2023/day21/sample.day21 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day22.py b/2023/day22.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day22.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day22/input.day22 b/2023/day22/input.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day22/sample.day22 b/2023/day22/sample.day22 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day23.py b/2023/day23.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day23.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day23/input.day23 b/2023/day23/input.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day23/sample.day23 b/2023/day23/sample.day23 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day24.py b/2023/day24.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day24.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day24/input.day24 b/2023/day24/input.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day24/sample.day24 b/2023/day24/sample.day24 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day25.py b/2023/day25.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2023/day25.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2023/day25/input.day25 b/2023/day25/input.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2023/day25/sample.day25 b/2023/day25/sample.day25 new file mode 100644 index 0000000..e69de29 diff --git a/2023/helpingFunctions.py b/2023/helpingFunctions.py new file mode 100644 index 0000000..5d2a60b --- /dev/null +++ b/2023/helpingFunctions.py @@ -0,0 +1,42 @@ +import sys, os + +sampleMode = False + +def identifyDay(inputArgument): + twoDigitsDay = '00' + day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'XX') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] + twoDigitsDay = str(day).zfill(2) + return twoDigitsDay + +def identifyYear(inputArgument): + inputArgument = inputArgument[:inputArgument.rfind('/')] + inputArgument = inputArgument[inputArgument.rfind('/')+1:] + year = int(inputArgument) if (inputArgument.isnumeric()) else 0 + fourDigitsYear = str(year).zfill(4) + return fourDigitsYear + +def setSampleMode(mode:bool): + global sampleMode + if (mode) : sampleMode = True + return + +def getSampleMode(): + return sampleMode + +def showSampleMode(): + if ( getSampleMode() ): + print ("----------------------") + print ("Running im Sample Mode") + print ("----------------------") + return + +def getPath2Data(aocDay,aocYear): + return './'+str(aocYear)+'/day'+str(aocDay)+'/' + +def getFilename2Data(aocDay): + dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'input.day'+str(aocDay) + return dataFilename + +def readDataFile (path, filename): + data = '' + return data \ No newline at end of file diff --git a/2024/__pycache__/helpingFunctions.cpython-311.pyc b/2024/__pycache__/helpingFunctions.cpython-311.pyc deleted file mode 100644 index f7966a6..0000000 Binary files a/2024/__pycache__/helpingFunctions.cpython-311.pyc and /dev/null differ diff --git a/2024/day00.py b/2024/day00.py index 3ad7a86..e57c061 100644 --- a/2024/day00.py +++ b/2024/day00.py @@ -8,22 +8,26 @@ from helpingFunctions import * setSampleMode(False) -gameScoreA=0 -gameScoreB=0 - aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) -path = getPath2Data(aocDay) +path = getPath2Data(aocDay,aocYear) filename = getFilename2Data(aocDay) +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + def task(task: int,data) -> int: score=0 if task == 1: - global gameScoreA - score = gameScoreA + score = taskA(data) elif task == 2: - global gameScoreB - score = gameScoreB + score = taskB(data) return score def main(): diff --git a/2024/day01.py b/2024/day01.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day01.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day02.py b/2024/day02.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day02.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day03.py b/2024/day03.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day03.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day04.py b/2024/day04.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day04.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day05.py b/2024/day05.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day05.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day06.py b/2024/day06.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day06.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day07.py b/2024/day07.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day07.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day08.py b/2024/day08.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day08.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day09.py b/2024/day09.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day09.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day10.py b/2024/day10.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day10.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day11.py b/2024/day11.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day11.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day12.py b/2024/day12.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day12.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day13.py b/2024/day13.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day13.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day14.py b/2024/day14.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day14.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day15.py b/2024/day15.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day15.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day16.py b/2024/day16.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day16.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day17.py b/2024/day17.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day17.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day18.py b/2024/day18.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day18.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day19.py b/2024/day19.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day19.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day20.py b/2024/day20.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day20.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day21.py b/2024/day21.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day21.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day22.py b/2024/day22.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day22.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day23.py b/2024/day23.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day23.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day24.py b/2024/day24.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day24.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/day25.py b/2024/day25.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/2024/day25.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/2024/helpingFunctions.py b/2024/helpingFunctions.py index 03d1cb0..5d2a60b 100644 --- a/2024/helpingFunctions.py +++ b/2024/helpingFunctions.py @@ -4,10 +4,17 @@ sampleMode = False def identifyDay(inputArgument): twoDigitsDay = '00' - day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'X') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] + day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'XX') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] twoDigitsDay = str(day).zfill(2) return twoDigitsDay +def identifyYear(inputArgument): + inputArgument = inputArgument[:inputArgument.rfind('/')] + inputArgument = inputArgument[inputArgument.rfind('/')+1:] + year = int(inputArgument) if (inputArgument.isnumeric()) else 0 + fourDigitsYear = str(year).zfill(4) + return fourDigitsYear + def setSampleMode(mode:bool): global sampleMode if (mode) : sampleMode = True @@ -23,11 +30,11 @@ def showSampleMode(): print ("----------------------") return -def getPath2Data(aocDay): - return './day'+str(aocDay)+'/' +def getPath2Data(aocDay,aocYear): + return './'+str(aocYear)+'/day'+str(aocDay)+'/' def getFilename2Data(aocDay): - dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'data.day'+str(aocDay) + dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'input.day'+str(aocDay) return dataFilename def readDataFile (path, filename): diff --git a/initScripts/makefolders.sh b/initScripts/makefolders.sh index e34798e..ed380e4 100755 --- a/initScripts/makefolders.sh +++ b/initScripts/makefolders.sh @@ -6,9 +6,21 @@ then mkdir ${year} fi cd ${year} +if [ ! -f "helpingFuctions.py" ] +then + cp ../yearTemplate/helpingFunctions.py ./helpingFunctions.py +fi for i in {00..25} do - mkdir day${i} + if [ ! -d "day${i}" ] + then + mkdir day${i} + fi + touch ./day${i}/input.day${i} touch ./day${i}/sample.day${i} + if [ ! -f "day${i}.py" ] + then + cp ../yearTemplate/dayXX.py day${i}.py + fi done diff --git a/yearTemplate/dayXX.py b/yearTemplate/dayXX.py new file mode 100644 index 0000000..e57c061 --- /dev/null +++ b/yearTemplate/dayXX.py @@ -0,0 +1,47 @@ +# AOC Day Script Day XX +# Date : 20XX.12.XX +# Python Code +# Developer : David Bandeira + +import sys,time +from helpingFunctions import * + +setSampleMode(False) + +aocDay = identifyDay(sys.argv[0]) +aocYear = identifyYear(sys.argv[0]) + +path = getPath2Data(aocDay,aocYear) +filename = getFilename2Data(aocDay) + +def taskA (data) -> int: + gameScoreA = 0 + return gameScoreA + +def taskB (data) -> int: + gameScoreB = 0 + return gameScoreB + +def task(task: int,data) -> int: + score=0 + if task == 1: + score = taskA(data) + elif task == 2: + score = taskB(data) + return score + +def main(): + showSampleMode() + try: + data = open(path+'/'+filename).read().strip().split('\n') + except: + print ('no inputfile found') + print ('please check file %s on path %s' % (filename, path)) + quit() + st=time.time() + print ('Day '+aocDay+': Tasks 1: '+ str(task(1,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + st=time.time() + print ('Day '+aocDay+': Tasks 2: '+ str(task(2,data))+ ' executation time: ' + str(int((time.time()-st)*1000)) + 'ms') + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/yearTemplate/helpingFunctions.py b/yearTemplate/helpingFunctions.py new file mode 100644 index 0000000..5d2a60b --- /dev/null +++ b/yearTemplate/helpingFunctions.py @@ -0,0 +1,42 @@ +import sys, os + +sampleMode = False + +def identifyDay(inputArgument): + twoDigitsDay = '00' + day = 0 if (inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] == 'XX') else inputArgument[inputArgument.rfind('/')+4:inputArgument.rfind('.')] + twoDigitsDay = str(day).zfill(2) + return twoDigitsDay + +def identifyYear(inputArgument): + inputArgument = inputArgument[:inputArgument.rfind('/')] + inputArgument = inputArgument[inputArgument.rfind('/')+1:] + year = int(inputArgument) if (inputArgument.isnumeric()) else 0 + fourDigitsYear = str(year).zfill(4) + return fourDigitsYear + +def setSampleMode(mode:bool): + global sampleMode + if (mode) : sampleMode = True + return + +def getSampleMode(): + return sampleMode + +def showSampleMode(): + if ( getSampleMode() ): + print ("----------------------") + print ("Running im Sample Mode") + print ("----------------------") + return + +def getPath2Data(aocDay,aocYear): + return './'+str(aocYear)+'/day'+str(aocDay)+'/' + +def getFilename2Data(aocDay): + dataFilename = 'sample.day'+str(aocDay) if ( sampleMode ) else 'input.day'+str(aocDay) + return dataFilename + +def readDataFile (path, filename): + data = '' + return data \ No newline at end of file