Yeah, I was thinking about this on the way home and I think that I can just add padding even if it's not necessary (e.g. just always add "...." to the start and end of the string regardless and remove it later). I think that should work because the main thing is the "offset" (can't think of a better term) where index 0 is. I think that might work. I also put some thought (yes, my drive home is long lol) into representing things as a number, as you suggested, rather than a string but I tentatively concluded that doing that might actually make the pattern matching harder because of leading zeroes. I haven't discarded the idea, but what I would like to do first is get it working for the first 1001 generations so that I can see if a pattern emerges in either the pattern itself or the "password" for each generation.
My current output is (generation, string, "password") but I have to fix the padding issue -- haven't had time yet. 19 generations is not enough for me to see a pattern so I'll have to get the padding working. Since the "password" increases over time I believe the offset must also increase and maybe the pattern is there, but I'll wait and see
Code:
t = 0,"....#..#.#..##......###...###...........",145
t = 1,"....#...#....#.....#..#..#..#..........",91
t = 2,"....##..##...##....#..#..#..##.........",132
t = 3,"...#.#...#..#.#....#..#..#...#.........",102
t = 4,"....#.#..#...#.#...#..#..##..##........",154
t = 5,".....#...##...#.#..#..#...#...#........",115
t = 6,".....##.#.#....#...#..##..##..##.......",174
t = 7,"....#..###.#...##..#...#...#...#.......",126
t = 8,"....#....##.#.#.#..##..##..##..##......",213
t = 9,"....##..#..#####....#...#...#...#......",138
t = 10,"...#.#..#...#.##....##..##..##..##.....",213
t = 11,"....#...##...#.#...#.#...#...#...#.....",136
t = 12,"....##.#.#....#.#...#.#..##..##..##....",218
t = 13,"...#..###.#....#.#...#....#...#...#....",133
t = 14,"...#....##.#....#.#..##...##..##..##...",235
t = 15,"...##..#..#.#....#....#..#.#...#...#...",149
t = 16,"..#.#..#...#.#...##...#...#.#..##..##..",226
t = 17,"...#...##...#.#.#.#...##...#....#...#..",170
t = 18,"...##.#.#....#####.#.#.#...##...##..#..",247
t = 19,"..#..###.#..#.#.#######.#.#.#..#.#..#..",286
Edit, t = 3 and 13 to 18 are probably wrong because of the padding issue but interestingly t = 19 is nevertheless correct