To All:
日来天气闷热无所获,偶得此批处理对抗调度程序,同时随意写了一个最简单的对抗代码。虽然作了一些公平性处理,但仍然无法完全达到公平对抗的目标。在数次的测试中,均是优先调度的失败。看看大家有什么办法。
Scheduler.cmd - V1 - 批处理代码对抗调度程序
test1.cmd & test2.cmd
日来天气闷热无所获,偶得此批处理对抗调度程序,同时随意写了一个最简单的对抗代码。虽然作了一些公平性处理,但仍然无法完全达到公平对抗的目标。在数次的测试中,均是优先调度的失败。看看大家有什么办法。
Scheduler.cmd - V1 - 批处理代码对抗调度程序
:: Scheduler.cmd - V1 - 批处理代码对抗调度程序
:: Will Sort - 2006-06-28 - CMD@WinXP
@echo off & setlocal
if not exist battle\ md battle
copy test1.cmd battle>nul
copy test2.cmd battle>nul
cd battle
:Wait1
if 1%time:~6,2% GEQ 157 goto Wait1
set /a sec=1%time:~6,2%+3
set wartime=%time:~0,6%%sec:~1,2%.00
echo Wartime:%wartime%
start test2.cmd %wartime% test1.cmd 2>nul
start test1.cmd %wartime% test2.cmd 2>nul
:Wait2
if exist test1.cmd if exist test2.cmd goto wait2
:Finish
if not exist test1.cmd echo test1 fail!
if not exist test2.cmd echo test2 fail!
cd..
pause
test1.cmd & test2.cmd
@echo off
:Wait
if not "%time%"=="%1" goto wait
echo %time%.
echo Start %0 at %time% ...
:Start
del %2
if exist %2 goto start
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
