Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 68,104 of 68,980    |
|    Herbert Kleebauer to R.Wieser    |
|    Re: %random% is not random?    |
|    22 Oct 23 10:49:55    |
      From: klee@unibwm.de              On 22.10.2023 10:13, R.Wieser wrote:              >> They use the seed not as a seed but as the first       >> random number and that I would call a bug.       >       > At least two points of view :       >       > 1) Is the number random enough to be used ? Than what does it matter ?              If you put this batch in the autostart folder, you can       use an old Laptop as a digital picture frame. After       power on, it displays the pictures in the directory       %p% in a fixed order (not random), but starting at       a random position. If you switch on the Laptop every       day at nearly the same time, you will always see the       same pictures. I wouldn't call this "random enough".       Therefore the otherwise meaningless line:       set r=%random% %random% %random%                            @echo off       :: timeout /t 10       set p=d:\test\tmp2       set iv=D:\Programme\IrfanView\i_view32.exe              cd /d %p%       set n=0       if exist list.txt del list.txt       for %%i in (*.jpg) do (        set /a n=n+1        echo %p%\%%i>>list.txt)       set r=%random% %random% %random%       set /a n=%random%*(n-1)/32767       more +%n% list.txt>list1.txt       copy /b list1.txt + list.txt       %iv% /slideshow=%p%\list1.txt              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca