aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-06-26 03:01:41 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-06-26 03:01:41 +0300
commit873060e1c2ee56b1c6120f5227cfca261dc7fbf4 (patch)
treef8161b09367c2c3116312e4b91eae0faefb4dbc2
parentquicksort: seed RNG (diff)
downloadsorting-algorithms-873060e1c2ee56b1c6120f5227cfca261dc7fbf4.tar.gz
sorting-algorithms-873060e1c2ee56b1c6120f5227cfca261dc7fbf4.zip
code style
Diffstat (limited to '')
-rw-r--r--plot.bat44
1 files changed, 20 insertions, 24 deletions
diff --git a/plot.bat b/plot.bat
index c215b7e..aced087 100644
--- a/plot.bat
+++ b/plot.bat
@@ -3,45 +3,41 @@
@rem See LICENSE.txt for details.
@setlocal enabledelayedexpansion
+@echo off
-@set DEFAULT_ITERATIONS=100
-@set DEFAULT_MIN=0
-@set DEFAULT_MAX=200
+set DEFAULT_ITERATIONS=100
+set DEFAULT_MIN=0
+set DEFAULT_MAX=200
-@if E%1 == E goto :print_usage
-@set algorithm=%1
+if E%1 == E goto :exit_with_usage
+set algorithm=%1
-@if not E%2 == E (
+if not E%2 == E (
set iterations=%2
) else (
set iterations=%DEFAULT_ITERATIONS%
)
-@if not E%3 == E (
+if not E%3 == E (
set min=%3
) else (
set min=%DEFAULT_MIN%
)
-@if not E%4 == E (
+if not E%4 == E (
set max=%4
) else (
set max=%DEFAULT_MAX%
)
-plot.py "%algorithm%" --min "%min%" --max "%max%" ^
- --iterations "%iterations%" --input best ^
- --output "%algorithm%_%iterations%_best_%min%_%max%.png" ^
- || exit /b !errorlevel!
-plot.py "%algorithm%" --min "%min%" --max "%max%" ^
- --iterations "%iterations%" --input average ^
- --output "%algorithm%_%iterations%_average_%min%_%max%.png" ^
- || exit /b !errorlevel!
-plot.py "%algorithm%" --min "%min%" --max "%max%" ^
- --iterations "%iterations%" --input worst ^
- --output "%algorithm%_%iterations%_worst_%min%_%max%.png" ^
- || exit /b !errorlevel!
+for %%i in (best average worst) do (
+ plot.py "%algorithm%" ^
+ --input "%%i" ^
+ --min "%min%" --max "%max%" ^
+ --iterations "%iterations%" ^
+ --output "%algorithm%_%iterations%_%%i_%min%_%max%.png" || exit /b !errorlevel!
+)
-@exit /b
+exit /b
-:print_usage:
-@echo Usage: %0 ALGORITHM [ITERATIONS=%DEFAULT_ITERATIONS% [MIN=%DEFAULT_MIN% [MAX=%DEFAULT_MAX%]]]
-@exit /b 1
+:exit_with_usage:
+echo Usage: %0 ALGORITHM [ITERATIONS=%DEFAULT_ITERATIONS% [MIN=%DEFAULT_MIN% [MAX=%DEFAULT_MAX%]]]
+exit /b 1