So, I was talking with Weregoose today about De Bruijn sequences, and I was intrigued (I think he was doing something for Sonlen or something, I don't know. I guess I did a bunch of work and saved 10 bytes in a program ). He had a list of bit strings, and he wanted to find the De Bruijn sequence representing them. I decided it might be fun to make a program that does just that, so I did. I think it's pretty neat. You pass it in a bunch of strings, and it finds the sequence for them. It generalizes glyphs, so it doesn't have to be ones and zeros, it can be anything. Here's the results for what he needed:
And here's the same thing using percent signs and greater-than signs:
It also doesn't need to be just two characters, you can do it with three or four etc. Here it is with zeros, ones, and twos:
Right now it needs that you have basically every string of length n on the alphabet a of size sigma to work, but I plan on making it try to fill in gaps if it can't get a sequence that works. It implies the length of each string based on the first one, so if your first string is five characters, all the rest need to be, too. It adds glyphs as it finds them, so you don't need to specify which glyphs to use, just input it as you see fit. It also generates the graph and outputs it so you can check it out:
I'd like to make it so that it actually draws the graph, too, at some point.
Download it at: http://merthsoft.com/SequenceFinder.zip. Note that it's pretty buggy, and I don't do any error checking, so it will crash if you don't put stuff in just right.
And here's the same thing using percent signs and greater-than signs:
It also doesn't need to be just two characters, you can do it with three or four etc. Here it is with zeros, ones, and twos:
Right now it needs that you have basically every string of length n on the alphabet a of size sigma to work, but I plan on making it try to fill in gaps if it can't get a sequence that works. It implies the length of each string based on the first one, so if your first string is five characters, all the rest need to be, too. It adds glyphs as it finds them, so you don't need to specify which glyphs to use, just input it as you see fit. It also generates the graph and outputs it so you can check it out:
I'd like to make it so that it actually draws the graph, too, at some point.
Download it at: http://merthsoft.com/SequenceFinder.zip. Note that it's pretty buggy, and I don't do any error checking, so it will crash if you don't put stuff in just right.