title: SET /a var1 = var1 + 1 /a not recognised as an internal or external command
body: <p>So here is my code</p>
  
  <pre><code>IF %FIT% leq %FITLAST% set /a "MUTA=MUTA-1" ELSE set /A "MUTA=MUTA+1"
  </code></pre>
  
  <p>This is for AI, it sees if this generation is fitter than the last one or not and adjusts the likelyhood of repeating the same characteristics or magnifying them. Don't worry about the AI side that is sound I have made this in java I am just moving it over to batch for a challenge and am having all sorts of syntax errors xD</p>
  
  <p>Essentially if this generation is less fit or equally fit to the last, then decrease MUTA by 1 (reducing the likely hood of repeating the same action. If this generation is more fit than the last then increase MUTA by 1 which will increase the likely hood of repeating the same action.</p>
  
  <p>The issue is where it sees /a as a command on its own and obviously can't recognise it as it is just part of SETs syntax.</p>
  
  <p>EDIT: THIS WAS ANSWERED ^^^^</p>
  
  <p>Okay I hope you can help me with the problems caused in the extended code as well:</p>
  
  <pre><code>IF "%FIT%" leq "%FITLAST%" (
  set /a "MUTA=MUTA-1"
  ) ELSE (
  set /A "MUTA=MUTA+1"
  )
  
  if %num%&gt;50(
      SET DIR=DOWN
      if %num%&gt;(50+%MUTA%) SET DIR=UP
  )
  pause
  if %num%&lt;50(
      SET DIR=RIGHT
      if %num%&lt;(%MUTA%) SET DIR=LEFT
  )
  </code></pre>
  
  <p>This doesn't return anything it just closes the console even with the pause command in there. I am looking here for an answer that corrects my inevitably wrong syntax on something that I have missed out instead of reorganising it to solve a problem as this is definitely just my syntax being wrong.</p>