Trying to get a better position in the steps part of the competition, I wrote new programs.

Using more heads, I attack the string from both ends. This requires more rules, because I don’t have to just address the cases A, B and C, but also “A on one end, B on the other” etc., 9 combinations in all. It’s also a little more complicated detecting, that I am done.
I do something similar for part 2:

For part 3, I already had a nice 10 head program, so I didn’t do anything more.
Bonus: I experimented with using less rules for part 2. Because there are 5 heads, a lot of the time I can just write 5 P’s. And I gain a step, because I only use 1 step to spread the heads.
