Commit Graph

41 Commits

Author SHA1 Message Date
75013fbcdd Grid.move() 2023-09-17 04:08:00 +02:00
9f11e12bc4 Grid: a whole bunch of bugfixing around transformations and mode3d
Grid: added __eq__()
2022-12-25 18:36:37 +01:00
ca4c67f805 some bug fixing around 3d grids 2022-12-25 05:19:57 +01:00
9963a21821 Grid: finalizing shift(), adding shift_zero() 2022-12-24 06:12:44 +01:00
5bae00234c Grid.recalcBoundaries() (for when grids get smaller, which is not tracked by default)
Grid.from_str() and Grid.print() now accept translate dicts for more complex grid values
2022-12-23 08:00:21 +01:00
47446f3f35 Grid.shift() - shift whole coordinate system 2022-12-22 09:35:09 +01:00
798e8c3faa reformat 2022-12-19 04:49:46 +01:00
2692f4b560 Grid.getPath_BFS() 2022-12-14 19:37:03 +01:00
642a32b884 Grid.count(); Grid.print() not handles Enums 2022-12-14 06:51:55 +01:00
00de38a277 Coordinate.getNeighbours() and Grid.getNeighboursOf() can be generators; no need to create extra lists every time 2022-12-12 08:11:29 +01:00
5df82d2359 reversable coordinates; grid.print() can now mark important spots 2022-12-10 14:50:22 +01:00
35972bffe2 aoc_ocr 2022-12-10 10:29:39 +01:00
011abd7fb5 set default in from_string and allow "true" to become any value 2022-12-04 11:11:27 +01:00
afcafbba0a set default in from_string 2022-12-04 10:58:17 +01:00
ab05a1a770 fix transformations 2022-12-04 10:57:28 +01:00
Stefan Harmuth
b6360d18ed grid.Grid(): getActiveRegion(); returns connected !default regions 2022-11-30 11:20:48 +01:00
Stefan Harmuth
c16bc0d1cf *real* start to hex coordinates 2022-11-29 20:37:46 +01:00
4f45d1f32d start on hexgrids 2022-11-28 08:18:43 +01:00
987a5bab28 better dealing with boundaries
getting circles (mind the FIXME)
2022-08-14 13:25:33 +02:00
c5428a4ea5 keep a more accurate track of boundaries 2022-08-14 12:32:37 +02:00
f83709758c set shaped areas in a grid 2022-08-10 23:34:58 +02:00
Stefan Harmuth
1e1f5ef126 list comp is faster than building lists yourself 2022-01-14 12:29:54 +01:00
Stefan Harmuth
3590c2550c apparently this is faster than min()/max() ... ?! 2022-01-14 11:58:26 +01:00
Stefan Harmuth
5bf2ec1c47 Grid.range[XYZ]: make ranges reverable 2021-12-25 06:48:17 +01:00
Stefan Harmuth
3b0a6480a3 Grid.range[XYZ]: ability to pad the range
Grid.toggleGrid(): toggle everything!
Grid.getSum(): give correct sum even if the default is not 0
2021-12-20 08:30:19 +01:00
Stefan Harmuth
d8d7112098 Grid.transform() in 3D! 2021-12-19 16:26:50 +01:00
Stefan Harmuth
072ba02831 make things faster/cleaner 2021-12-15 11:49:14 +01:00
Stefan Harmuth
11604338e8 make things faster/cleaner 2021-12-15 11:30:30 +01:00
Stefan Harmuth
2c859033fd grid.getPath(): Use heap to ease finding smallest f_cost node 2021-12-15 11:09:58 +01:00
Stefan Harmuth
af2aea1a34 still trying to make grid.getPath() faster 2021-12-15 09:42:10 +01:00
Stefan Harmuth
235a545c70 grid.getPath(): allow for grid values to be movement/distance weights
also: lambdas are sloooooooow
2021-12-15 07:49:57 +01:00
Stefan Harmuth
a507b004f9 allow getActiveCells() to return only one row/column
annotation/import fixed
2021-12-13 11:10:38 +01:00
Stefan Harmuth
e16c21b3bb Node() is not a list anymore 2021-12-13 07:44:21 +01:00
Stefan Harmuth
3c855e6749 range methods
better get()
allow print() to be useful with false/true grids
2021-12-13 07:19:27 +01:00
Stefan Harmuth
d5a278ceef a* (untested) 2021-12-13 06:18:25 +01:00
Stefan Harmuth
4ab6519321 annotation cleanup
add grid.mul() and grid.div()
2021-12-11 07:15:32 +01:00
Stefan Harmuth
7b52ce4fba codeline cleanup 2021-12-11 06:47:33 +01:00
Stefan Harmuth
abbf1c85e1 grid.Grid: finally add that stupid print() method I'm always writing for debugging
grid.Grid: add(), sub() and set() return what they've actually wrote to the cell
2021-12-11 06:45:24 +01:00
Stefan Harmuth
55a12f7dc8 don't assume what an "OFF_STATE" might be, use the supplied default instead 2021-12-09 06:20:57 +01:00
Stefan Harmuth
393e846926 import woes 2021-12-07 08:50:02 +01:00
Stefan Harmuth
5c811280d7 move everything into a submodule to avoid namespace collisions 2021-12-07 06:30:52 +01:00