jonnycomes / look_and_say

A python module for exploring look and say sequences in the spirit of John H Conway.
https://jonnycomes.github.io/look_and_say/
MIT License
1 stars 0 forks source link

Implement circular look and says #11

Closed jonnycomes closed 2 years ago

jonnycomes commented 2 years ago

In each term in a circular look and say sequence, we identify the end of the string with the beginning. For example, the string '012345678910' is the same as '001234567891'. Thus, the count of the first and last run of characters many need to be combined.

There should be a CircularLookAndSay class. This could be a wrapper of LookAndSay. Maybe there is a better design choice here?

jonnycomes commented 2 years ago

Note: after circular look and says are implemented, it would be nice to implement the drawing of look and say rings.

jonnycomes commented 2 years ago

One way (the correct way?) to do this is implement necklace objects. A necklace is just a string where the first character is declared to be adjacent (after) the last character. However, when you split a necklace, you get strings back. Generating look and say necklaces isn't too difficult. However, one needs to (properly) implement the appropriate chemistry object for look and say necklaces. If a L&S necklace splits, then the persistent elements will be string-elements, but if the L&S necklace doesn't split you get persistent necklace-elements.

jonnycomes commented 2 years ago

This would really be better as a separate (student) project.