title: I have a repetition error somewhere in my batch file
body: <p>I have been trying to make a visualization tool for a Chinese abacus for the past hour, for this I need to isolate every number of the answer, but when I try and do this it repeats some numbers in a seemingly meaningless pattern.  For example when I plug in 12344+1 it gives me 123345455 as the final echo.  I have been struggling for quite awhile and would love some assistance, I am still quite a beginner at batch so I really have no idea why this is happening.</p>
  
  <p>P.S.
  Sorry for the messiness, like I said, I'm new</p>
  
  <pre><code>    @echo off
      SET a1=O
      SET a2=O
      SET a3=O
      SET a4=O
      SET a5=O
      SET b1=I
      SET b2=I
      SET b3=I
      SET b4=I
      SET b5=I
      SET c1=I
      SET c2=I
      SET c3=I
      SET c4=I
      set c5=I
      set d1=O
      set d2=O
      set d3=O
      set d4=O
      set d5=O
      set e1=O
      set e2=O
      set e3=O
      set e4=O
      set e5=O
      set f1=O
      set f2=O
      set f3=O
      set f4=O
      set f5=O
      set g1=O
      set g2=O
      set g3=O
      set g4=O
      set g5=O
      :beginning
      echo.
      echo Welcome to the virtual Abacus.
      echo.
      echo I am only a visualization and do not compute in the same way as an abacus.
      echo.
      echo Please be kind, as I can only handle single operator equations,
      echo and keep the answers to below 100,000 too please.
      echo ---------
      echo %a1% %a2% %a3% %a4% %a5% 
      echo %b1% %b2% %b3% %b4% %b5% 
      echo ---------
      echo %c1% %c2% %c3% %c4% %c5% 
      echo %d1% %d2% %d3% %d4% %d5% 
      echo %e1% %e2% %e3% %e4% %e5% 
      echo %f1% %f2% %f3% %f4% %f5% 
      echo %g1% %g2% %g3% %g4% %g5% 
      echo ---------
      set /p Equation=What is your question?
      set /a result=%Equation%
      set Res1=%result:~0,1%
      set Res2=%result:~1,2%
      set Res3=%result:~2,3%
      set Res4=%result:~3,4%
      set Res5=%result:~4,5%
      echo %Res1%%Res2%%Res3%%Res4%%Res5%
      pause
  </code></pre>