aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plot.bat
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-03-08 17:43:55 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-03-08 17:43:55 +0300
commit622206cacb166e8ac65b05733582fd404042cc0b (patch)
tree32069d09b1972673ce837c55866a5e3826017b9e /plot.bat
parentREADME update (diff)
downloadsorting-algorithms-622206cacb166e8ac65b05733582fd404042cc0b.tar.gz
sorting-algorithms-622206cacb166e8ac65b05733582fd404042cc0b.zip
refactoring
Diffstat (limited to 'plot.bat')
-rw-r--r--plot.bat12
1 files changed, 8 insertions, 4 deletions
diff --git a/plot.bat b/plot.bat
index e389c5c..70b1f64 100644
--- a/plot.bat
+++ b/plot.bat
@@ -4,23 +4,27 @@
@setlocal enabledelayedexpansion
+@set DEFAULT_REPETITIONS=100
+@set DEFAULT_MIN=0
+@set DEFAULT_MAX=200
+
@if E%1 == E goto :print_usage
@set algorithm=%1
@if not E%2 == E (
set repetitions=%2
) else (
- set repetitions=100
+ set repetitions=%DEFAULT_REPETITIONS%
)
@if not E%3 == E (
set min=%3
) else (
- set min=0
+ set min=%DEFAULT_MIN%
)
@if not E%4 == E (
set max=%4
) else (
- set max=200
+ set max=%DEFAULT_MAX%
)
plot.py -l "%algorithm%" -a "%min%" -b "%max%" -r "%repetitions%" ^
@@ -36,5 +40,5 @@ plot.py -l "%algorithm%" -a "%min%" -b "%max%" -r "%repetitions%" ^
@exit /b
:print_usage:
-@echo Usage: %0 ALGORITHM [REPETITIONS [MIN [MAX]]]
+@echo Usage: %0 ALGORITHM [REPETITIONS=%DEFAULT_REPETITIONS% [MIN=%DEFAULT_MIN% [MAX=%DEFAULT_MAX%]]]
@exit /b 1