@echo off

echo Compiling generators, solutions and checkers
(g++ -Wall -O2 gen.cpp -o gen.exe)
cd ..
(g++ -Wall -O2 stock_dp.cpp -o stock_dp.exe)
(g++ -Wall -O2 stock_full_bruteforce_dp.cpp -o stock_full_bruteforce_dp.exe)
cd stress
(g++ -Wall -O2 check.cpp -o check.exe)

echo Stressing
for /L %%i in (1, 1, 100500) do (
  gen.exe
  cd ..
  stock_dp.exe
  stock_full_bruteforce_dp.exe
  cd stress
  rem fc stock.out stock_bruteforce.out || exit
  check.exe
  echo Test %%i: OK
  echo %TIME%
)