code cleanup

This commit is contained in:
2021-07-25 16:53:07 +02:00
parent f5ba7165c0
commit 0223d4bd2c
2 changed files with 3 additions and 5 deletions

View File

@@ -20,7 +20,7 @@ ex1:
@#$(TIME) ex1-c 2020 < $(INPUT) 2>&1 @#$(TIME) ex1-c 2020 < $(INPUT) 2>&1
ex2: ex2:
@#$(TIME) ex2.bash < $(INPUT) 2>&1 @$(TIME) ex2.bash < $(INPUT) 2>&1
@#$(TIME) ex1-c 30000000 < $(INPUT) 2>&1 @#$(TIME) ex1-c 30000000 < $(INPUT) 2>&1
clean: clean:

View File

@@ -6,10 +6,9 @@ CMD=${0##*/}
set -o noglob set -o noglob
shopt -s extglob shopt -s extglob
#declare -A strings
declare -a strings T R B L RT RR RB RL nums declare -a strings T R B L RT RR RB RL nums
declare -i res=1 count=-1
declare -i count=-1
while read -r line; do while read -r line; do
case ${line:0:1} in case ${line:0:1} in
T*) T*)
@@ -54,10 +53,9 @@ for key in "${!nums[@]}"; do
done done
ALL="${T[@]} ${R[@]} ${B[@]} ${L[@]} ${RT[@]} ${RR[@]} ${RB[@]} ${RL[@]}" ALL="${T[*]} ${R[*]} ${B[*]} ${L[*]} ${RT[*]} ${RR[*]} ${RB[*]} ${RL[*]}"
ALLSIZE=${#ALL} ALLSIZE=${#ALL}
declare -i res=1 count
for ((i=0; i<${#nums[@]}; ++i)); do for ((i=0; i<${#nums[@]}; ++i)); do
count=0 count=0