Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/Pick-random-element/Batch-File/pick-random-element.bat
Normal file
16
Task/Pick-random-element/Batch-File/pick-random-element.bat
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
|
||||
::Initializing the pseudo-array...
|
||||
set "pseudo=Alpha Beta Gamma Delta Epsilon"
|
||||
set cnt=0 & for %%P in (!pseudo!) do (
|
||||
set /a cnt+=1
|
||||
set "pseudo[!cnt!]=%%P"
|
||||
)
|
||||
::Do the random thing...
|
||||
set /a rndInt=%random% %% cnt +1
|
||||
|
||||
::Print the element corresponding to rndint...
|
||||
echo.!pseudo[%rndInt%]!
|
||||
pause
|
||||
exit /b
|
||||
Loading…
Add table
Add a link
Reference in a new issue