[Solved] Jump to random sections

Score
0
Vote Up
February 17, 2012 at 05:23:31 Pacific
Specs: Windows 7

I need to jump to random sections to reduce the number of the same names created in each system.
E.g
Sometimes it will go to a, b or c.
:A
echo. Lauren
pause
:B
echo. Anni
pause
:C
echo. Joe
pause

Jump to Best Answer ↓   Report •


#1
Vote Down
Score
1
Vote Up
February 17, 2012 at 17:55:11 Pacific

Best Answer

@echo off
set /a randnum=%random% %% 3
set /a randnum+=1
if %randnum%==1 goto A
if %randnum%==2 goto B
if %randnum%==3 goto C
:A
echo Lauren
pause
goto EOF
:B
echo Anni
pause
goto EOF
:C
echo Joe
pause
:EOF

Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
February 18, 2012 at 02:23:43 Pacific

Just tested and it works. Appreciate it.

Reply ↓  Report •

Reply to Message Icon Start New Discussion
Related Posts

« Java bits shifting within... creating a point of sale ... »