Commit Graph

28 Commits

Author SHA1 Message Date
Stefan Harmuth
a8a0873eec pre-optimizing the opcode makes p1 take twice the time, but p2 almost twice as fast 2020-12-08 10:51:26 +01:00
Stefan Harmuth
8277dfe0f9 we only need to check the instructions up to the infinite loop - everything else cannot contain the error 2020-12-08 09:43:28 +01:00
Stefan Harmuth
761e3bf975 only check for 'nop' if the check for 'jmp' failes. Saves 0.5ms :) 2020-12-08 09:12:24 +01:00
Stefan Harmuth
b4ff7c58d0 TIL: enumerate() exists; no more manual counting 2020-12-08 09:09:50 +01:00
Stefan Harmuth
aa5ae674ec only int-cast param when needed 2020-12-08 09:04:38 +01:00
Stefan Harmuth
9b0b8eb1f6 makes parsing minimally faster (and also more readable) 2020-12-08 08:55:18 +01:00
Stefan Harmuth
29b0604952 [:] does the same and is minimally faster than .copy() 2020-12-08 06:36:24 +01:00
Stefan Harmuth
f9a0472f85 this is not an f-string anymore 2020-12-08 06:24:27 +01:00
Stefan Harmuth
aa07b45ba7 day 8 2020-12-08 06:23:43 +01:00
Stefan Harmuth
bc64ff468d use python's own timeit module instead of our own halfbaked implementation 2020-12-07 11:00:58 +01:00
Stefan Harmuth
8eecddaf60 note to myself: set()s are much faster than list()s and auto-eliminate duplicates 2020-12-07 10:35:09 +01:00
Stefan Harmuth
aa29aaedd4 day 7 2020-12-07 06:54:43 +01:00
Stefan Harmuth
a1e946494b get rid of numpy makes it >10x faster 2020-12-06 08:44:55 +01:00
Stefan Harmuth
6aa821c6f4 day 6 + central testing 2020-12-06 08:16:26 +01:00
Stefan Harmuth
d4380883b2 add execution time measuring 2020-12-05 12:16:30 +01:00
Stefan Harmuth
3e8103fd39 day 5 2020-12-05 06:36:47 +01:00
Stefan Harmuth
5389f899d5 no need to check further if a match has been found 2020-12-04 08:52:33 +01:00
Stefan Harmuth
a70f2daf7f day 4 2020-12-04 07:06:51 +01:00
Stefan Harmuth
a3d2b5140f better (and faster) solution 2020-12-03 11:00:59 +01:00
Stefan Harmuth
fcd394aaba more input process options 2020-12-03 09:57:10 +01:00
Stefan Harmuth
95e56b9333 day3 2020-12-03 07:05:29 +01:00
Stefan Harmuth
f70c759582 build in asserts when running single day scripts 2020-12-02 10:57:53 +01:00
Stefan Harmuth
d49d0bb8fe getting rid of exec() and ugly "TEST in globals()" 2020-12-02 10:26:00 +01:00
Stefan Harmuth
5f1e68270b day2 2020-12-02 09:17:39 +01:00
Stefan Harmuth
6348ae58a3 add test option 2020-12-01 11:27:01 +01:00
Stefan Harmuth
a0408e9873 stop pycharm from complaining :) 2020-12-01 08:41:32 +01:00
Stefan Harmuth
b5d4852d82 main.py running all days 2020-12-01 08:40:31 +01:00
Stefan Harmuth
10a569faed day1 2020-12-01 08:19:38 +01:00