day20, starting to read in data
with using tests as entry points for checking things
This commit is contained in:
35
day20/notes.org
Normal file
35
day20/notes.org
Normal file
@@ -0,0 +1,35 @@
|
||||
#+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
|
||||
Reference in New Issue
Block a user