good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Odometer pattern iterator (in C).by hdb (Monsignor) |
on May 29, 2015 at 12:06 UTC ( [id://1128261]=note: print w/replies, xml ) | Need Help?? |
Translating that regex into C is trivial: (1) Find rightmost occurence of substring '01' (we are done if there is none), (2) change '01' to '10', (3) reverse the string to the right of that. Finding the indices of the '1's is also simple.
In Section
Seekers of Perl Wisdom
|
|