Commit Graph

228 Commits

Author SHA1 Message Date
587fee299f chop string via division 2025-12-02 09:30:40 +01:00
105ab06cd9 playing around with temperatures and humidity 2025-05-25 18:03:38 +02:00
c4fb68f809 some move string manipulations 2025-01-12 09:47:28 +01:00
17c41a0c63 start moving away from fishhook onto dedicated type sub-classes, which allows for pypy to come along 2025-01-06 09:14:49 +01:00
270866387e coordinate.py: predefine neighbouring coordinates 2024-12-12 09:04:36 +01:00
6adb1ff457 math.concat(): concatenate 2 integers (e.g. contcat(12, 34) == 1234) 2024-12-07 06:51:33 +01:00
e06e536292 math: MAXINT* constants 2024-12-07 06:41:16 +01:00
dd39c90f13 math.magnitude(): return order of magnitude of a number 2024-12-07 06:35:55 +01:00
24cd561370 aoc.AOCDay(): add internal cache set for standard "have I seen this value?" situations. Adds SEEN (the set), seen_reset() and seen() 2024-12-06 07:32:55 +01:00
23283d3b66 irc.Client(): implement sasl authentication and send queue
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m31s
2024-11-30 10:26:21 +01:00
bfac2b9433 redefined int_seq.factorial(); takes 4 times longer than math.factorial(), but is pure python and allows for sequences not starting with 1 2024-11-03 14:17:59 +01:00
3ac82ee526 int_seq.hexagonal() 2024-10-10 15:33:39 +02:00
d6fad1511c Grid.find(): generator yielding coordinates that hold a specific value 2024-01-09 06:52:04 +01:00
cf72a5451f aoc.AOCDay: introduce class variable "DP", a dictionary that gets reset before every part method call, useful for memoization problems 2024-01-03 05:46:24 +01:00
87fbaeafbe coordinate.Shape: add __contains__()
coordinate.Line: add __contains__(), __len__() and proper __eq__()
NEW: coordinate.Polygon: deal with Polygons defined by a list of Coordinates (in (counter)?clockwise order. Currently allows for rectilinear decomposition and area calculation
2024-01-01 21:48:17 +01:00
94cffbbd74 visualization: Add Color Enum
visualization: add draw methods for points and rectangles
2024-01-01 21:41:08 +01:00
e3309415b7 tools.minmax(): remove broken code; why was that even there? 2024-01-01 21:40:00 +01:00
2d7d339bf0 visualization.Window(): better boundary box handling 2023-12-28 06:54:54 +01:00
ed0fe0dafc visualization.Window.done(): choose to realign or not (default: yes) 2023-12-28 06:48:22 +01:00
87eff61ae2 visualization.Window.realign(): scale to fit 2023-12-28 06:47:17 +01:00
0aedd1c612 NEW: visualization.Window(): simple Tk visualization class, can just draw some lines for now, but with working realignment, zooming and panning 2023-12-28 06:09:16 +01:00
8dea09c30f expand coordinate.Line functionality 2023-12-28 06:07:39 +01:00
f7d1fde5b7 NEW: itertools.len_combinations_of_sum() 2023-12-26 12:49:37 +01:00
600d0e716c combinations_of_sum moved to new itertools module 2023-12-25 23:17:18 +01:00
5d5e9fb8e5 NEW: AOCDay.run_part(): when timing, shift all following progress bars down by one to not interfere 2023-12-25 19:45:31 +01:00
916ab481cf NEW: AOCDay.progress() - add a progress bar to your long-running solutions 2023-12-25 15:47:36 +01:00
4ce70c8565 AOCDay.run_part(): When in timeit mode, display progress bar 2023-12-25 12:31:06 +01:00
ee3b5ee941 Stopwatch() can now be restarted and will automatically sum up all intervals between start() and stop() calls 2023-12-25 12:29:49 +01:00
4d1b075086 NEW: itertools.len_permutations() and itertools.len_combinations() -> get the amount of results the respective itertools function would yield 2023-12-25 11:24:12 +01:00
1e43a2ff0d NEW: coordinate.Line() - only 2D for now, but can calc intersections 2023-12-24 12:14:47 +01:00
cc1fd86ede NEW: Coordinate() now accepts floats; what can possibly go wrong? 2023-12-24 12:13:58 +01:00
9386c40ea5 FIX: Coordinate.__new__(): return correct class instead of always Coordinate() (fucked up subclassing) 2023-12-23 09:44:36 +01:00
14d535911c NEW: Coordinate().__mod__() 2023-12-22 05:55:29 +01:00
fb3bef0153 Coordinate().getLineTo(): handle target == self 2023-12-18 16:38:11 +01:00
ffcc1e14c0 NEW tools.list_combinations_of_sum() - returns all possible tuples with len [length}, containing integers summing up to {total_sum} 2023-12-18 09:12:34 +01:00
1a111488ba FIX Coordinate().getLineTo() index bug 2023-12-18 09:11:06 +01:00
02623f8c9a NEW Grid.getRegion() -> Generator over all Coordinates of connected cells with the same value inside Grid borders 2023-12-18 07:00:05 +01:00
b2cc1e814c FIX Coordinate().getNeighbours() min/maxY
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m4s
FIX Coordinate() not hashable after implementing __eq__
2023-12-17 08:24:19 +01:00
42cbf6f85c Coordinate().__eq__: enable comparison with tuples 2023-12-17 07:21:00 +01:00
2bec56eb1c AOCDay.is_test() returns a bool, True if the solution for the current part/input_file is known; else False 2023-12-16 12:04:11 +01:00
f0e499f0a3 escape patterns want to be raw strings 2023-12-15 07:34:38 +01:00
1fb4582908 AOCDay._submit(): maybe display rank on correct answer? 2023-12-15 07:30:06 +01:00
2de9725adb Grid(): make use of the fact that Coordinate is a tupple for some speedups
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m18s
2023-12-14 16:18:25 +01:00
32c07d2913 Coordinate() now behaves more tupley-like (methods not accept tuples as parameters, including __add__ and __sub__) 2023-12-14 15:08:49 +01:00
0408432e3d Grid() is now hashable 2023-12-14 11:24:37 +01:00
f22c3bd798 Grid.isWithinBoundaries(): allow for boundary padding 2023-12-14 09:55:51 +01:00
c4b9b10b71 Grid.get_column() and Grid.get_row() 2023-12-13 06:37:24 +01:00
a47077f102 convey high/low hints if present
All checks were successful
Publish to PyPI / Publish to PyPI (push) Successful in 1m29s
2023-12-03 14:53:56 +01:00
db23b11a98 convey high/low hints if present 2023-12-03 14:51:57 +01:00
de8796d415 Grid.from_data() 2023-12-03 14:35:17 +01:00