aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plot.sh
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-06 21:45:45 +0200
committerEgor Tensin <egor@tensin.name>2026-06-06 21:45:45 +0200
commitfba834a617d2d2905cfc84595de100f8a5368c0a (patch)
tree2b629a72dacfec75a6cf28a298ff309602cfff5d /plot.sh
parentworkflows/ci: remove on: pull_request (diff)
downloadsorting-algorithms-fba834a617d2d2905cfc84595de100f8a5368c0a.tar.gz
sorting-algorithms-fba834a617d2d2905cfc84595de100f8a5368c0a.zip
sort out scripts into proper directories
Diffstat (limited to 'plot.sh')
-rwxr-xr-xplot.sh49
1 files changed, 0 insertions, 49 deletions
diff --git a/plot.sh b/plot.sh
deleted file mode 100755
index 60bad3a..0000000
--- a/plot.sh
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright (c) 2019 Egor Tensin <Egor.Tensin@gmail.com>
-# This file is part of the "Sorting algorithms" project.
-# For details, see https://github.com/egor-tensin/sorting-algorithms.
-# Distributed under the MIT License.
-
-set -o errexit -o nounset -o pipefail
-shopt -s inherit_errexit lastpipe
-
-script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
-script_dir="$( cd -- "$script_dir" && pwd )"
-readonly script_dir
-script_name="$( basename -- "${BASH_SOURCE[0]}" )"
-readonly script_name
-
-readonly default_iterations=100
-readonly default_min=0
-readonly default_max=200
-
-main() {
- if [ "$#" -lt 1 ] || [ "$#" -gt 4 ]; then
- echo "usage: $script_name ALGORITHM [ITERATIONS [MIN_VALUE [MAX_VALUE]]]" >&2
- exit 1
- fi
-
- local algorithm="$1"
- local iterations="$default_iterations"
- [ "$#" -ge 2 ] && iterations="$2"
- local min="$default_min"
- [ "$#" -ge 3 ] && min="$3"
- local max="$default_max"
- [ "$#" -ge 4 ] && max="$4"
-
- mkdir -p -- "$script_dir/img"
-
- local input_kind
- for input_kind in best average worst; do
- local output_name="${algorithm}_${iterations}_${input_kind}_${min}_${max}.png"
- python "$script_dir/plot.py" \
- "$algorithm" \
- --input "$input_kind" \
- --min "$min" --max "$max" \
- --iterations "$iterations" \
- --output "$script_dir/img/$output_name"
- done
-}
-
-main "$@"