day10, still not working
This commit is contained in:
@@ -109,3 +109,51 @@ A⌜.
|
||||
A.B
|
||||
|
||||
i guess i could just code that.
|
||||
** it also doesn't work. pipes to into place where whole 3x3 is path pipes and info on 'outer' is lost
|
||||
** will it work to cound intersections between a point and Top \ Left direction?
|
||||
** hypothesis - from the point, count up, down, left & right - intersections with the golden path.
|
||||
if into U&D or L&R both are odd - then inside.
|
||||
short circuit - if into 1 direction number is 0 - definitely outside
|
||||
|
||||
and that's square? could kube? well, there shouldn't be too many points without the pipe already
|
||||
|
||||
maybe i can somehow count for the whole map?
|
||||
|
||||
if element on path - increase by 1 value from top
|
||||
*** also, what if i could consturct couter example before i start coding, you know
|
||||
with the point that is outside, but has odd in two sides?
|
||||
|
||||
yes, i think there's a counter example with a point which has 3 on all sides because of path going directly to that side
|
||||
but maybe we don't count that as 'crossing'? only if we what? cross non-parallel line?
|
||||
|
||||
that could be it
|
||||
** ok, last idea, yes, count intersections
|
||||
one additonal [][]int
|
||||
from top to bottom. take value from top, if it's pipe (and doesn't have down movemnt) increase by 1
|
||||
if it's not on path and has Even number, already count as Outer
|
||||
** oh, come on .
|
||||
|
||||
7
|
||||
|
|
||||
L is 1
|
||||
|
||||
but
|
||||
7
|
||||
|
|
||||
J is 0
|
||||
|
||||
how to account for that?
|
||||
monitor the left and right somehow.
|
||||
have another map, store left or right in previous cell if we are in top thingy?
|
||||
|
||||
if we're on path, and previous is empty - store left or right?
|
||||
so, copy previous
|
||||
|
||||
and if we're counting up - store nothing.
|
||||
|
||||
or just monitor angles?
|
||||
maybe have stack? of seen path elements?
|
||||
and some elements take off?
|
||||
** ok, one more attempt?
|
||||
not counting, but maintaining a stack?
|
||||
and opposite angles take the element off the stack?
|
||||
|
||||
Reference in New Issue
Block a user