[Tutor] CBNC control loop.

Tesla Coil tescoil@rtpro.net
Sun, 19 Mar 2000 15:28:24 -0600


> # Desired result:  keyword TOMATO generates idxlist
> # [3, 9, 15, 21, 2, 8, 14, 20, 26, 1, 7, 13, 19, 25, 5, 11, 17, 23,
> # 0, 6, 12, 18, 24, 4, 10, 16, 22]
> # Close-But-No-Cigar control loop results in:
> # [9, 15, 21, 27, 8, 14, 20, 26, 32, 7, 13, 19, 25, 31, 11, 17, 23,
> # 29, 6, 12, 18, 24, 30, 10, 16, 22, 28]
>
> # CBNC control loop here:
> for n in range(len(seqlist)):
>    idxpos = seqlist[n]
>        while idxpos <= len(message):
>            idxpos = idxpos+len(seqlist)
>            idxlist.append(idxpos)

# I guess I just needed a nap...
for n in range(len(seqlist)):
     idxpos = seqlist[n]
     idxlist.append(idxpos)
         while idxpos+len(seqlist)<= len(message):
              idxpos = idxpos+len(seqlist)
              idxlist.append(idxpos)

I'll probably be back later to ask if there's a better way
to do what I'm doing (and to explain what I'm doing).