:: usage: testwar warrior [rounds] [outfile] :: charts warrior performance using qbasic :: coresize 800, processes 800, cycles 8000 :: edit to specify test directory :: -f fixed sequence @echo off if .%1==.Sub goto process if .%1==. echo no warrior specified if .%1==. goto end :: set to benchmark directory... set test=d:\cwstuff\tinybm04 :: default rounds... set rnds=1000 if not .%2==. set rnds=%2 :: pmars command line... (note: fixed sequence) set pmars=pmars -b -l 20 -d 20 -s 800 -p 800 -c 8000 -r %rnds% -f :: listing program... (types if empty) set list= if exist %1 goto fileok echo file not found goto end :fileok if exist %test%\*.red goto testok echo no test redcode goto end :testok echo Testing... rem>battle$1.out for %%a in (%test%\*.red) do call %0 Sub %1 %%a del score$$ echo>name.bat @echo off echo>>name.bat set name=%%1 find ";name"<%1>getname$.bat call getname$.bat del getname$.bat del name.bat :: modified to permit higher rounds echo>rank$.bas :on error goto X echo>>rank$.bas open "battle$1.out" for input as #1:open "score$2" for output as #2 echo>>rank$.bas ? #2, "Battle details for warrior %name%":? #2,"" echo>>rank$.bas ? #2, "Opponent Scores Results Performance of %name%" echo>>rank$.bas ? #2, "--------------- --------- ----------- ---------=---------=---------=---------=" echo>>rank$.bas L:line input #1,a$:if instr(a$,"scores ")=0 goto L echo>>rank$.bas line input #1,b$:line input #1,c$:if instr(a$,"%name%")=0 goto L echo>>rank$.bas w$=left$(b$,instr(b$," by ")):w$=left$(w$+" ",15) echo>>rank$.bas ms=val(right$(a$,len(a$)-instr(a$,"scores ")-6)):ts=ts+ms echo>>rank$.bas os=val(right$(b$,len(b$)-instr(b$,"scores ")-6)):no=no+1 echo>>rank$.bas ms$=left$(str$(ms)+" ",5):os$=left$(str$(os)+" ",5) echo>>rank$.bas re$=right$(c$,len(c$)-8):re$=left$(re$+" ",13) echo>>rank$.bas ? #2,w$;ms$;os$;" ";re$;:if os+ms=0 or ms=0 goto N echo>>rank$.bas ra=(ms/(%rnds%*3))*40:for z=1 to ra:? #2,"*";:next z echo>>rank$.bas N:? #2,"":goto L echo>>rank$.bas X:? #2,"--------------- --------- ----------- ---------=---------=---------=---------=" echo>>rank$.bas if not no=0 then ? #2,"Adjusted Score:";int(((ts/no)/(%rnds%/100))*10)/10 echo>>rank$.bas close #1:close #2:system qbasic /run rank$.bas del rank$.bas if not .%3==. copy score$2 %3>nul if not .%3==. goto notype if not .%list%==. call %list% score$2 if not .%list%==. goto notype type score$2|more pause :notype del score$2 del battle$1.out goto end :process >score$$ %pmars% %2 %3 type score$$ type score$$>>battle$1.out :end