day20: more diagramming
This commit is contained in:
parent
727099dbd9
commit
53930e66ac
|
@ -204,6 +204,7 @@ func (c *Conjunction)StateSnapshot() string {
|
||||||
|
|
||||||
func (c *Conjunction)MermaidFlow() string {
|
func (c *Conjunction)MermaidFlow() string {
|
||||||
result := "\n"
|
result := "\n"
|
||||||
|
result += fmt.Sprintf("%s{%s}\n", c.Name, c.Name)
|
||||||
for _, toName := range c.OutputNames {
|
for _, toName := range c.OutputNames {
|
||||||
result += fmt.Sprintf("%s --> %s\n", c.Name, toName)
|
result += fmt.Sprintf("%s --> %s\n", c.Name, toName)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,105 @@
|
||||||
flowchart LR
|
flowchart LR
|
||||||
|
|
||||||
zd --> ln
|
gm --> tj
|
||||||
zd --> gf
|
gm --> gf
|
||||||
|
|
||||||
vz --> cr
|
nn --> ff
|
||||||
vz --> vc
|
nn --> db
|
||||||
|
|
||||||
ch --> db
|
broadcast --> sr
|
||||||
ch --> mc
|
broadcast --> ch
|
||||||
|
broadcast --> hd
|
||||||
|
broadcast --> bx
|
||||||
|
|
||||||
qm --> gm
|
qm --> gm
|
||||||
|
|
||||||
cc --> nn
|
|
||||||
|
|
||||||
qk --> vc
|
|
||||||
|
|
||||||
sr --> gf
|
|
||||||
sr --> vl
|
|
||||||
|
|
||||||
lr --> sb
|
|
||||||
|
|
||||||
hv --> lr
|
|
||||||
|
|
||||||
cl --> qx
|
|
||||||
cl --> bf
|
|
||||||
|
|
||||||
xm --> db
|
xm --> db
|
||||||
|
|
||||||
sf --> bp
|
pf --> qx
|
||||||
|
|
||||||
tj --> lc
|
ln --> gf
|
||||||
tj --> gf
|
ln --> qq
|
||||||
|
|
||||||
|
pm --> vc
|
||||||
|
pm --> qk
|
||||||
|
|
||||||
rz --> qx
|
rz --> qx
|
||||||
rz --> cv
|
rz --> cv
|
||||||
|
|
||||||
|
gf{gf}
|
||||||
|
gf --> fj
|
||||||
|
gf --> qm
|
||||||
|
gf --> xn
|
||||||
|
gf --> sr
|
||||||
|
|
||||||
|
fn --> pr
|
||||||
|
fn --> gf
|
||||||
|
|
||||||
|
lc --> gf
|
||||||
|
lc --> fn
|
||||||
|
|
||||||
|
sr --> gf
|
||||||
|
sr --> vl
|
||||||
|
|
||||||
|
jz --> qj
|
||||||
|
jz --> db
|
||||||
|
|
||||||
|
th{th}
|
||||||
|
th --> rx
|
||||||
|
|
||||||
|
cb --> kt
|
||||||
|
|
||||||
|
bf --> qx
|
||||||
|
bf --> pf
|
||||||
|
|
||||||
|
qj --> xm
|
||||||
|
qj --> db
|
||||||
|
|
||||||
|
ch --> db
|
||||||
|
ch --> mc
|
||||||
|
|
||||||
|
ff --> pl
|
||||||
|
|
||||||
|
pr --> gf
|
||||||
|
|
||||||
|
zd --> ln
|
||||||
|
zd --> gf
|
||||||
|
|
||||||
|
qn{qn}
|
||||||
|
qn --> th
|
||||||
|
|
||||||
|
kt --> qx
|
||||||
|
kt --> rz
|
||||||
|
|
||||||
|
fj --> zd
|
||||||
|
|
||||||
|
tj --> lc
|
||||||
|
tj --> gf
|
||||||
|
|
||||||
|
bx --> qx
|
||||||
|
bx --> qp
|
||||||
|
|
||||||
|
cr --> gx
|
||||||
|
cr --> vc
|
||||||
|
|
||||||
|
vm --> cl
|
||||||
|
|
||||||
|
nh --> hv
|
||||||
|
|
||||||
|
qk --> vc
|
||||||
|
|
||||||
|
jd --> qx
|
||||||
|
jd --> vm
|
||||||
|
|
||||||
|
hd --> vc
|
||||||
|
hd --> nh
|
||||||
|
|
||||||
|
sf --> bp
|
||||||
|
|
||||||
|
cl --> qx
|
||||||
|
cl --> bf
|
||||||
|
|
||||||
|
vc{vc}
|
||||||
vc --> lr
|
vc --> lr
|
||||||
vc --> hd
|
vc --> hd
|
||||||
vc --> ks
|
vc --> ks
|
||||||
|
@ -43,111 +108,17 @@ vc --> gx
|
||||||
vc --> nh
|
vc --> nh
|
||||||
vc --> hv
|
vc --> hv
|
||||||
|
|
||||||
bf --> qx
|
bp --> db
|
||||||
bf --> pf
|
bp --> jz
|
||||||
|
|
||||||
jd --> qx
|
cc --> nn
|
||||||
jd --> vm
|
|
||||||
|
|
||||||
ds --> cc
|
lr --> sb
|
||||||
|
|
||||||
vm --> cl
|
|
||||||
|
|
||||||
ff --> pl
|
|
||||||
|
|
||||||
th --> rx
|
|
||||||
|
|
||||||
gm --> tj
|
|
||||||
gm --> gf
|
|
||||||
|
|
||||||
fj --> zd
|
|
||||||
|
|
||||||
mc --> ds
|
|
||||||
mc --> db
|
|
||||||
|
|
||||||
ks --> vz
|
|
||||||
button --> broadcast
|
|
||||||
|
|
||||||
cv --> xz
|
|
||||||
|
|
||||||
kt --> qx
|
|
||||||
kt --> rz
|
|
||||||
|
|
||||||
qj --> xm
|
|
||||||
qj --> db
|
|
||||||
|
|
||||||
bx --> qx
|
|
||||||
bx --> qp
|
|
||||||
|
|
||||||
fn --> pr
|
|
||||||
fn --> gf
|
|
||||||
|
|
||||||
qp --> cb
|
|
||||||
qp --> qx
|
|
||||||
|
|
||||||
cd --> pm
|
|
||||||
cd --> vc
|
|
||||||
|
|
||||||
nh --> hv
|
|
||||||
|
|
||||||
pl --> sf
|
|
||||||
pl --> db
|
|
||||||
|
|
||||||
qq --> qm
|
qq --> qm
|
||||||
qq --> gf
|
qq --> gf
|
||||||
|
|
||||||
xf --> th
|
db{db}
|
||||||
|
|
||||||
zl --> th
|
|
||||||
|
|
||||||
pf --> qx
|
|
||||||
|
|
||||||
qn --> th
|
|
||||||
|
|
||||||
jz --> qj
|
|
||||||
jz --> db
|
|
||||||
|
|
||||||
pr --> gf
|
|
||||||
|
|
||||||
vl --> gf
|
|
||||||
vl --> fj
|
|
||||||
|
|
||||||
sb --> ks
|
|
||||||
sb --> vc
|
|
||||||
|
|
||||||
cr --> gx
|
|
||||||
cr --> vc
|
|
||||||
|
|
||||||
lc --> gf
|
|
||||||
lc --> fn
|
|
||||||
|
|
||||||
xn --> th
|
|
||||||
|
|
||||||
nn --> ff
|
|
||||||
nn --> db
|
|
||||||
|
|
||||||
ln --> gf
|
|
||||||
ln --> qq
|
|
||||||
|
|
||||||
pm --> vc
|
|
||||||
pm --> qk
|
|
||||||
|
|
||||||
xz --> jd
|
|
||||||
|
|
||||||
gx --> cd
|
|
||||||
|
|
||||||
broadcast --> sr
|
|
||||||
broadcast --> ch
|
|
||||||
broadcast --> hd
|
|
||||||
broadcast --> bx
|
|
||||||
|
|
||||||
qx --> cb
|
|
||||||
qx --> cv
|
|
||||||
qx --> bx
|
|
||||||
qx --> xz
|
|
||||||
qx --> vm
|
|
||||||
qx --> zl
|
|
||||||
|
|
||||||
db --> ff
|
db --> ff
|
||||||
db --> ds
|
db --> ds
|
||||||
db --> sf
|
db --> sf
|
||||||
|
@ -155,16 +126,53 @@ db --> ch
|
||||||
db --> cc
|
db --> cc
|
||||||
db --> xf
|
db --> xf
|
||||||
|
|
||||||
cb --> kt
|
vl --> gf
|
||||||
|
vl --> fj
|
||||||
|
|
||||||
bp --> db
|
ks --> vz
|
||||||
bp --> jz
|
|
||||||
|
|
||||||
gf --> fj
|
xn{xn}
|
||||||
gf --> qm
|
xn --> th
|
||||||
gf --> xn
|
|
||||||
gf --> sr
|
|
||||||
|
|
||||||
hd --> vc
|
xf{xf}
|
||||||
hd --> nh
|
xf --> th
|
||||||
|
|
||||||
|
pl --> sf
|
||||||
|
pl --> db
|
||||||
|
|
||||||
|
zl{zl}
|
||||||
|
zl --> th
|
||||||
|
|
||||||
|
vz --> cr
|
||||||
|
vz --> vc
|
||||||
|
|
||||||
|
gx --> cd
|
||||||
|
|
||||||
|
mc --> ds
|
||||||
|
mc --> db
|
||||||
|
|
||||||
|
qp --> cb
|
||||||
|
qp --> qx
|
||||||
|
button --> broadcast
|
||||||
|
|
||||||
|
cv --> xz
|
||||||
|
|
||||||
|
xz --> jd
|
||||||
|
|
||||||
|
qx{qx}
|
||||||
|
qx --> cb
|
||||||
|
qx --> cv
|
||||||
|
qx --> bx
|
||||||
|
qx --> xz
|
||||||
|
qx --> vm
|
||||||
|
qx --> zl
|
||||||
|
|
||||||
|
hv --> lr
|
||||||
|
|
||||||
|
cd --> pm
|
||||||
|
cd --> vc
|
||||||
|
|
||||||
|
sb --> ks
|
||||||
|
sb --> vc
|
||||||
|
|
||||||
|
ds --> cc
|
||||||
|
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 141 KiB |
|
@ -177,3 +177,4 @@ crap
|
||||||
all loops are from step 1.
|
all loops are from step 1.
|
||||||
|
|
||||||
it's just for some reason code was unstable when i was searching for all
|
it's just for some reason code was unstable when i was searching for all
|
||||||
|
*** answer is 224046542165867
|
||||||
|
|
|
@ -11,15 +11,16 @@ func Run() int {
|
||||||
// fmt.Println("hello from dya 20")
|
// fmt.Println("hello from dya 20")
|
||||||
|
|
||||||
filename := "day20/input"
|
filename := "day20/input"
|
||||||
// modules := ReadModules(filename)
|
modules := ReadModules(filename)
|
||||||
// InitStuffs(modules)
|
InitStuffs(modules)
|
||||||
// log.Print("got modules:\n", modules)
|
// log.Print("got modules:\n", modules)
|
||||||
|
|
||||||
// var low, high int
|
// var low, high int
|
||||||
// low, high = Count10000ButtonPresses(modules)
|
// low, high = Count10000ButtonPresses(modules)
|
||||||
// log.Printf("got low %d and high %d\n", low, high)
|
// log.Printf("got low %d and high %d\n", low, high)
|
||||||
|
|
||||||
CheckSubgraphsStuff(filename)
|
// CheckSubgraphsStuff(filename)
|
||||||
|
fmt.Print( AllMermaidFlowChard(modules) )
|
||||||
|
|
||||||
var result int
|
var result int
|
||||||
// result = CalcCommonStep()
|
// result = CalcCommonStep()
|
||||||
|
|
Loading…
Reference in New Issue