Hello, I need to make a program which draws a random number 1-3 twice, but doesn't allow for duplicates.
Here is what I have:
As you can see that will pick 2 numbers out of a random num 1- 3, however currently there is nothing to stop it from drawing duplicates. Is there anyway to stop duplicates from being echo'ed ?
Thanks!
Here is what I have:
echo off
cls
:begin~!
set /a count=count+1
set /a pool=3*%random%/32768+1
echo %pool%
if %count% == 2 goto !stop!
goto begin~!
exit
:!stop!
set /a count=nul
pause
goto begin~!
As you can see that will pick 2 numbers out of a random num 1- 3, however currently there is nothing to stop it from drawing duplicates. Is there anyway to stop duplicates from being echo'ed ?
Thanks!