Spiral Print Pattern For Alternative Rectangles "X" and "O"

I dont Know why it is giving the garbage value