Shouldn't the code say:
position = (position + direction + 1) % 12;
Or have I misunderstood something? position = (position + direction + 1) % 12;
Or have I misunderstood something?