Goofy Gorilla - 2011-05-17 Sucks. Misuse of "begging the question" as an introduction to a snake segment (yeah) where she introduces a problem and doesn't even attempt to provide a general solution. We don't even get an algorithm to generate arbitrary valid slithers!
Couple of stars for the other stuff.
pastorofmuppets - 2011-05-18 I'm kind of relieved to see Vi Hart screw up, though.
pastorofmuppets - 2011-05-18 A stab at the snake grammar... first let's see if angle brackets work >
pastorofmuppets - 2011-05-18 I was never great at these. I think some of the εs are redundant. This also doesn't include "straight" (S here means start).
S -> L | R | ε
L -> LM | l | ε
R -> RT | r | ε
M -> LR | R | ε
T -> RL | L | ε
Line one reads: "S yields L or R or ε". ε is the empty string.
Uppercase are variables, lowercase are terminals. Start with S, and replace it with either L or R (or ε, which is like erasing it). Keep doing those kinds of replacements until there are no variables left. The resulting lowercase string should be a valid slither.
As for an algorithm... if you have this kind of grammar then the algorithm has a boring general solution, and google can provide it :)