title: Easy ROT13 Ruby "programme" mystery
body: <p>I made a simple ROT13 programme  and I don't understand one thing:</p>
  
  <pre><code>a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
  (a.length+1).times do |i|
    print  a[i + 13]
    if i&gt;13
      print a[i %14]
    end
  
  end
  </code></pre>
  
  <p>Outputs:</p>
  
  <pre><code>NOPQRSTUVWXYZABCDEFGHIJKLM
  </code></pre>
  
  <p>If I don't add <code>+1</code> after <code>a.length</code>, the iteration ends with the letter <code>L</code>. However, if I use <code>print a[i]</code> inside the iteration, it normally starts with <code>A</code> and ends with <code>Z</code> with no <code>+1</code> addition needed.</p>
  
  <p>Can someone explain this mystery for me? </p>