sorry if this is a little too vague but...
step one: find a spot large enough to for you to move just one tile to left or right doesn't really matter
step two: calculate if your tail would bump into something (if it will move, if it doesn't move on to step three)
step three:move one tile to the left or right, your tail should automatically sweep across the tiles in between where it was and where it is
edit: i forgot to mention but you can also tail sweep up or down