1. 程式人生 > >代碼對拍器

代碼對拍器

bat文件 || uil not .exe output code tput 數據

bat文件

一個exe用於不斷生成數據 (build)

另外兩個exe輸出結果並比較 (test1,test2)

一個文件夾存放結果(addr)

@echo off
setlocal enabledelayedexpansion

::here, code1 build data, code,cod2 test exe


set build=C:\Users\scientific\Desktop\code1\bin\Debug\code1.exe
set test1=C:\Users\scientific\Desktop\code\bin\Debug\code.exe
set test2=C:\Users\scientific\Desktop\code2\bin\Debug\code2.exe set addr=C:\Users\scientific\Desktop\test if not exist %addr% ( md %addr% ) for /l %%i in (1,1,1000) do ( cd %addr% %build% >%%i.txt %test1% <%%i.txt >output1_%%i.txt %test2% <%%i.txt >output2_%%i.txt fc output1_
%%i.txt output2_%%i.txt >nul && echo >nul || echo not same %%i set /a j=%%i%%100 if !j! equ 0 ( echo %%i th ) ) pause

代碼對拍器