Debian Codegraph @

texmf-dist/doc/latex/circuit-macros/examples/extras/Counting.m4

raw
1 .PS
2 # Counting.m4
3 gen_init
4
5 g = 0.4 # grid size
6 define grid { (($2)*g,-($1)*g) }
7 circlerad = 0.1
8
9 for i=1 to 4 do {
10 sprintf(`"$S_%g$:"',i) ljust at grid(i,-0.5)
11 for j=1 to 4 do { if i+j < 8 then {
12 sprintf(`"$s_{%g%g}$"',i,j) at grid(i,j) } } }
13
14 "$\vdots$" at grid(4.75,0)
15 for i=1 to 3 do { `"$\cdots$"' at grid(i,5) }
16 "$\cdots$" at grid(4,4)
17
18 P: grid(1,1)
19 for k=3 to 5 do {
20 for i=1 to k-1 do { if (k%2==1) then { m=i; n=k-i } else { m=k-i; n=i }
21 Q: grid(m,n)
22 arrow from P to Q chop
23 P: Q }
24 }
25
26 .PE