Advent-of-Code-2023/day20/notes.org

36 lines
1.2 KiB
Org Mode

#+title: Notes
* ok. only thought i had was to simulate the thing
have single executor, that takes head of the queue,
signals would be (to, from, type)
take 'to' out of the map, call it's 'process(from, type)'
and different types of executors would implement this differently.
and return a slice of new signals in order, to be appended.
if queue is empty - the single button press is propagated and all is well.
we will take snapshot of state, String() repr of all executors should be enough,
and save amount of signals sent so far
* also, i suppose i'd want to have entry points for fiddling with single executors to be test cases.
* modules to implement
** TODO Broadcast
** TODO Flip-Flop
** TODO Conjunction
** TODO Button
* i guess each module could test if string is it's a representation of this type
and would be able to parse it? into it's own struct?
well, those are just functions, since only methods are associated, so ok
* how do i run single tests?
** running tests from the module
#+begin_src bash
go test sunshine.industries/aoc2023/day20 -v
#+end_src
have file with `_test.go` and `func Test...(t *testing.T) {}` name
** running single test
#+begin_src bash
go test sunshine.industries/aoc2023/day20 -v -run TestParseFlipFlop
#+end_src