The code looks like you have the LED connected between two pins. Did your teacher tell you to do this? It is not the normal way of doing things. I hope there is an resistor in line with each LED as well.
To be honest the code is a bit pedestrian, by using arrays to hold the bit patterns it could be made about 10 times shorter.