Batch Changing Variable in if Statement
<p>The Problem is that the variables are not being changed by the if statements, and I do not know why. I have been messing around with it, and I could not find a way to make it work.</p>

<pre><code>:Sim
cls

set /a b=(3 * %random%) / 32768 + 1

set /a a=(3 * %random%) / 32768 + 1 

::Sets a random number between 1 and 3

if %a% == 1 set %a%=1

if %a% == 2 set %a%=2

if %a% == 3 set %a%=1

if %b% == 1 set %b%=2

if %b% == 2 set %b%=1

if %b% == 3 set %b%=2

::Is supposed to change the variable, but does not :(


echo %a%

echo %a%
:: only echos the random numbers

pause &gt; nul
goto Sim
</code></pre>