@echo off

echo Compiling generator...
dcc32 -cc genMaxDiff.dpr
dcc32 -cc genMax.dpr
dcc32 -cc genRand.dpr


echo Generating tests...
for %%i in (??.hand) do (
  copy %%i %%~ni > nul
)

genMaxDiff yes yes > 13
genMaxDiff yes no > 14
genMaxDiff no yes > 15
genMaxDiff no no> 16

genMax yes yes > 17
genMax yes no > 18
genMax no yes > 19
genMax no no > 20

genRand 347289 yes yes > 21
genRand 347289 no yes > 22
genRand 347289 yes no > 23
genRand 347289 no no > 24

genRand 347489 yes yes > 25
genRand 347489 no yes > 26
genRand 347489 yes no > 27
genRand 347489 no no > 28

genRand 345289 yes yes > 29
genRand 345289 no yes > 30
genRand 345289 yes no > 31
genRand 345289 no no > 32

genRand 445289 yes yes > 33
genRand 445289 no yes > 34
genRand 445289 yes no > 35
genRand 445289 no no > 36

genRand 455289 yes yes > 37
genRand 455289 no yes > 38
genRand 455289 yes no > 39
genRand 455289 no no > 40

genRand 455259 yes yes > 41
genRand 455259 no yes > 42
genRand 455259 yes no > 43
genRand 455259 no no > 44

rem java TestsGen 2 tests.lst
rem del TestsGen.class

cd ..
dcc32 -cc check.dpr
cd tests

echo Generating answers...
call tall ft

echo Checking answers...
call docheck ft

cd ..
for %%i in (*.exe *.~dpr *.dof *.dsk *.cfg *.in *.out *.a *.obj ?? *.class) do del %%i
dcc32 -cc check.dpr
cd tests
