From ca330b00bcec0ff5707ccbdc4e905e41c3dc8c9a Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Sun, 14 Feb 2021 20:26:57 -0500 Subject: [PATCH] Patches to patches to clean up patches --- patches/45_optionals.patch | 4 ---- patches/README.md | 2 +- patches/eowyn.sh | 8 +++++--- patches/gollum.sh | 2 +- patches/{ => patches}/01_hello.patch | 0 patches/{ => patches}/02_std.patch | 0 patches/{ => patches}/03_assignment.patch | 0 patches/{ => patches}/04_arrays.patch | 0 patches/{ => patches}/05_arrays2.patch | 0 patches/{ => patches}/06_strings.patch | 0 patches/{ => patches}/07_strings2.patch | 0 patches/{ => patches}/08_quiz.patch | 0 patches/{ => patches}/09_if.patch | 0 patches/{ => patches}/10_if2.patch | 0 patches/{ => patches}/11_while.patch | 0 patches/{ => patches}/12_while2.patch | 0 patches/{ => patches}/13_while3.patch | 0 patches/{ => patches}/14_while4.patch | 0 patches/{ => patches}/15_for.patch | 0 patches/{ => patches}/16_for2.patch | 0 patches/{ => patches}/17_quiz2.patch | 0 patches/{ => patches}/18_functions.patch | 0 patches/{ => patches}/19_functions2.patch | 0 patches/{ => patches}/20_quiz3.patch | 0 patches/{ => patches}/21_errors.patch | 0 patches/{ => patches}/22_errors2.patch | 0 patches/{ => patches}/23_errors3.patch | 0 patches/{ => patches}/24_errors4.patch | 0 patches/{ => patches}/25_errors5.patch | 0 patches/{ => patches}/26_hello2.patch | 0 patches/{ => patches}/27_defer.patch | 0 patches/{ => patches}/28_defer2.patch | 0 patches/{ => patches}/29_errdefer.patch | 0 patches/{ => patches}/30_switch.patch | 0 patches/{ => patches}/31_switch2.patch | 0 patches/{ => patches}/32_unreachable.patch | 0 patches/{ => patches}/33_iferror.patch | 0 patches/{ => patches}/34_quiz4.patch | 0 patches/{ => patches}/35_enums.patch | 0 patches/{ => patches}/36_enums2.patch | 0 patches/{ => patches}/37_structs.patch | 0 patches/{ => patches}/38_structs2.patch | 0 patches/{ => patches}/39_pointers.patch | 0 patches/{ => patches}/40_pointers2.patch | 0 patches/{ => patches}/41_pointers3.patch | 0 patches/{ => patches}/42_pointers4.patch | 0 patches/{ => patches}/43_pointers5.patch | 0 patches/{ => patches}/44_quiz5.patch | 0 patches/patches/45_optionals.patch | 1 + 49 files changed, 8 insertions(+), 9 deletions(-) delete mode 100644 patches/45_optionals.patch rename patches/{ => patches}/01_hello.patch (100%) rename patches/{ => patches}/02_std.patch (100%) rename patches/{ => patches}/03_assignment.patch (100%) rename patches/{ => patches}/04_arrays.patch (100%) rename patches/{ => patches}/05_arrays2.patch (100%) rename patches/{ => patches}/06_strings.patch (100%) rename patches/{ => patches}/07_strings2.patch (100%) rename patches/{ => patches}/08_quiz.patch (100%) rename patches/{ => patches}/09_if.patch (100%) rename patches/{ => patches}/10_if2.patch (100%) rename patches/{ => patches}/11_while.patch (100%) rename patches/{ => patches}/12_while2.patch (100%) rename patches/{ => patches}/13_while3.patch (100%) rename patches/{ => patches}/14_while4.patch (100%) rename patches/{ => patches}/15_for.patch (100%) rename patches/{ => patches}/16_for2.patch (100%) rename patches/{ => patches}/17_quiz2.patch (100%) rename patches/{ => patches}/18_functions.patch (100%) rename patches/{ => patches}/19_functions2.patch (100%) rename patches/{ => patches}/20_quiz3.patch (100%) rename patches/{ => patches}/21_errors.patch (100%) rename patches/{ => patches}/22_errors2.patch (100%) rename patches/{ => patches}/23_errors3.patch (100%) rename patches/{ => patches}/24_errors4.patch (100%) rename patches/{ => patches}/25_errors5.patch (100%) rename patches/{ => patches}/26_hello2.patch (100%) rename patches/{ => patches}/27_defer.patch (100%) rename patches/{ => patches}/28_defer2.patch (100%) rename patches/{ => patches}/29_errdefer.patch (100%) rename patches/{ => patches}/30_switch.patch (100%) rename patches/{ => patches}/31_switch2.patch (100%) rename patches/{ => patches}/32_unreachable.patch (100%) rename patches/{ => patches}/33_iferror.patch (100%) rename patches/{ => patches}/34_quiz4.patch (100%) rename patches/{ => patches}/35_enums.patch (100%) rename patches/{ => patches}/36_enums2.patch (100%) rename patches/{ => patches}/37_structs.patch (100%) rename patches/{ => patches}/38_structs2.patch (100%) rename patches/{ => patches}/39_pointers.patch (100%) rename patches/{ => patches}/40_pointers2.patch (100%) rename patches/{ => patches}/41_pointers3.patch (100%) rename patches/{ => patches}/42_pointers4.patch (100%) rename patches/{ => patches}/43_pointers5.patch (100%) rename patches/{ => patches}/44_quiz5.patch (100%) create mode 100644 patches/patches/45_optionals.patch diff --git a/patches/45_optionals.patch b/patches/45_optionals.patch deleted file mode 100644 index c945b5a..0000000 --- a/patches/45_optionals.patch +++ /dev/null @@ -1,4 +0,0 @@ -32c32 -< var answer: u8 = result; ---- -> var answer: u8 = result orelse 42; diff --git a/patches/README.md b/patches/README.md index 0a4e8e0..b3249fa 100644 --- a/patches/README.md +++ b/patches/README.md @@ -8,7 +8,7 @@ answers are here, so no peeking! ## Éowyn A Bash shell script named `eowyn.sh` dwells here. She heals the little broken -programs and places them in a `healed` directory, which is not committed to the +programs and places them in a `healed` directory, which is NOT committed to the repo. ```bash diff --git a/patches/eowyn.sh b/patches/eowyn.sh index 53b87d2..5a802f6 100755 --- a/patches/eowyn.sh +++ b/patches/eowyn.sh @@ -25,16 +25,18 @@ for broken in ../exercises/*.zig do # Remove the dir and extension, rendering the True Name. true_name=$(basename $broken .zig) + patch_name="patches/$true_name.patch" - if [[ -f $true_name.patch ]] + + if [[ -f $patch_name ]] then # Apply the bandages to the wounds, grow new limbs, let # new life spring into the broken bodies of the fallen. echo Healing $true_name... - patch --output=healed/$true_name.zig $broken $true_name.patch + patch --output=healed/$true_name.zig $broken $patch_name else echo Cannot heal $true_name. Making empty patch. - echo > $true_name.patch + echo > $patch_name fi done diff --git a/patches/gollum.sh b/patches/gollum.sh index 78c7756..423d376 100755 --- a/patches/gollum.sh +++ b/patches/gollum.sh @@ -10,7 +10,7 @@ cd $(dirname $(which $0)) f=$(basename ../exercises/$1*.zig .zig 2> /dev/null) b=../exercises/$f.zig a=../answers/$f.zig -p=$f.patch +p=patches/$f.patch printf "\tf: '$f'\n\tb: '$b'\n\ta: '$a'\n" diff --git a/patches/01_hello.patch b/patches/patches/01_hello.patch similarity index 100% rename from patches/01_hello.patch rename to patches/patches/01_hello.patch diff --git a/patches/02_std.patch b/patches/patches/02_std.patch similarity index 100% rename from patches/02_std.patch rename to patches/patches/02_std.patch diff --git a/patches/03_assignment.patch b/patches/patches/03_assignment.patch similarity index 100% rename from patches/03_assignment.patch rename to patches/patches/03_assignment.patch diff --git a/patches/04_arrays.patch b/patches/patches/04_arrays.patch similarity index 100% rename from patches/04_arrays.patch rename to patches/patches/04_arrays.patch diff --git a/patches/05_arrays2.patch b/patches/patches/05_arrays2.patch similarity index 100% rename from patches/05_arrays2.patch rename to patches/patches/05_arrays2.patch diff --git a/patches/06_strings.patch b/patches/patches/06_strings.patch similarity index 100% rename from patches/06_strings.patch rename to patches/patches/06_strings.patch diff --git a/patches/07_strings2.patch b/patches/patches/07_strings2.patch similarity index 100% rename from patches/07_strings2.patch rename to patches/patches/07_strings2.patch diff --git a/patches/08_quiz.patch b/patches/patches/08_quiz.patch similarity index 100% rename from patches/08_quiz.patch rename to patches/patches/08_quiz.patch diff --git a/patches/09_if.patch b/patches/patches/09_if.patch similarity index 100% rename from patches/09_if.patch rename to patches/patches/09_if.patch diff --git a/patches/10_if2.patch b/patches/patches/10_if2.patch similarity index 100% rename from patches/10_if2.patch rename to patches/patches/10_if2.patch diff --git a/patches/11_while.patch b/patches/patches/11_while.patch similarity index 100% rename from patches/11_while.patch rename to patches/patches/11_while.patch diff --git a/patches/12_while2.patch b/patches/patches/12_while2.patch similarity index 100% rename from patches/12_while2.patch rename to patches/patches/12_while2.patch diff --git a/patches/13_while3.patch b/patches/patches/13_while3.patch similarity index 100% rename from patches/13_while3.patch rename to patches/patches/13_while3.patch diff --git a/patches/14_while4.patch b/patches/patches/14_while4.patch similarity index 100% rename from patches/14_while4.patch rename to patches/patches/14_while4.patch diff --git a/patches/15_for.patch b/patches/patches/15_for.patch similarity index 100% rename from patches/15_for.patch rename to patches/patches/15_for.patch diff --git a/patches/16_for2.patch b/patches/patches/16_for2.patch similarity index 100% rename from patches/16_for2.patch rename to patches/patches/16_for2.patch diff --git a/patches/17_quiz2.patch b/patches/patches/17_quiz2.patch similarity index 100% rename from patches/17_quiz2.patch rename to patches/patches/17_quiz2.patch diff --git a/patches/18_functions.patch b/patches/patches/18_functions.patch similarity index 100% rename from patches/18_functions.patch rename to patches/patches/18_functions.patch diff --git a/patches/19_functions2.patch b/patches/patches/19_functions2.patch similarity index 100% rename from patches/19_functions2.patch rename to patches/patches/19_functions2.patch diff --git a/patches/20_quiz3.patch b/patches/patches/20_quiz3.patch similarity index 100% rename from patches/20_quiz3.patch rename to patches/patches/20_quiz3.patch diff --git a/patches/21_errors.patch b/patches/patches/21_errors.patch similarity index 100% rename from patches/21_errors.patch rename to patches/patches/21_errors.patch diff --git a/patches/22_errors2.patch b/patches/patches/22_errors2.patch similarity index 100% rename from patches/22_errors2.patch rename to patches/patches/22_errors2.patch diff --git a/patches/23_errors3.patch b/patches/patches/23_errors3.patch similarity index 100% rename from patches/23_errors3.patch rename to patches/patches/23_errors3.patch diff --git a/patches/24_errors4.patch b/patches/patches/24_errors4.patch similarity index 100% rename from patches/24_errors4.patch rename to patches/patches/24_errors4.patch diff --git a/patches/25_errors5.patch b/patches/patches/25_errors5.patch similarity index 100% rename from patches/25_errors5.patch rename to patches/patches/25_errors5.patch diff --git a/patches/26_hello2.patch b/patches/patches/26_hello2.patch similarity index 100% rename from patches/26_hello2.patch rename to patches/patches/26_hello2.patch diff --git a/patches/27_defer.patch b/patches/patches/27_defer.patch similarity index 100% rename from patches/27_defer.patch rename to patches/patches/27_defer.patch diff --git a/patches/28_defer2.patch b/patches/patches/28_defer2.patch similarity index 100% rename from patches/28_defer2.patch rename to patches/patches/28_defer2.patch diff --git a/patches/29_errdefer.patch b/patches/patches/29_errdefer.patch similarity index 100% rename from patches/29_errdefer.patch rename to patches/patches/29_errdefer.patch diff --git a/patches/30_switch.patch b/patches/patches/30_switch.patch similarity index 100% rename from patches/30_switch.patch rename to patches/patches/30_switch.patch diff --git a/patches/31_switch2.patch b/patches/patches/31_switch2.patch similarity index 100% rename from patches/31_switch2.patch rename to patches/patches/31_switch2.patch diff --git a/patches/32_unreachable.patch b/patches/patches/32_unreachable.patch similarity index 100% rename from patches/32_unreachable.patch rename to patches/patches/32_unreachable.patch diff --git a/patches/33_iferror.patch b/patches/patches/33_iferror.patch similarity index 100% rename from patches/33_iferror.patch rename to patches/patches/33_iferror.patch diff --git a/patches/34_quiz4.patch b/patches/patches/34_quiz4.patch similarity index 100% rename from patches/34_quiz4.patch rename to patches/patches/34_quiz4.patch diff --git a/patches/35_enums.patch b/patches/patches/35_enums.patch similarity index 100% rename from patches/35_enums.patch rename to patches/patches/35_enums.patch diff --git a/patches/36_enums2.patch b/patches/patches/36_enums2.patch similarity index 100% rename from patches/36_enums2.patch rename to patches/patches/36_enums2.patch diff --git a/patches/37_structs.patch b/patches/patches/37_structs.patch similarity index 100% rename from patches/37_structs.patch rename to patches/patches/37_structs.patch diff --git a/patches/38_structs2.patch b/patches/patches/38_structs2.patch similarity index 100% rename from patches/38_structs2.patch rename to patches/patches/38_structs2.patch diff --git a/patches/39_pointers.patch b/patches/patches/39_pointers.patch similarity index 100% rename from patches/39_pointers.patch rename to patches/patches/39_pointers.patch diff --git a/patches/40_pointers2.patch b/patches/patches/40_pointers2.patch similarity index 100% rename from patches/40_pointers2.patch rename to patches/patches/40_pointers2.patch diff --git a/patches/41_pointers3.patch b/patches/patches/41_pointers3.patch similarity index 100% rename from patches/41_pointers3.patch rename to patches/patches/41_pointers3.patch diff --git a/patches/42_pointers4.patch b/patches/patches/42_pointers4.patch similarity index 100% rename from patches/42_pointers4.patch rename to patches/patches/42_pointers4.patch diff --git a/patches/43_pointers5.patch b/patches/patches/43_pointers5.patch similarity index 100% rename from patches/43_pointers5.patch rename to patches/patches/43_pointers5.patch diff --git a/patches/44_quiz5.patch b/patches/patches/44_quiz5.patch similarity index 100% rename from patches/44_quiz5.patch rename to patches/patches/44_quiz5.patch diff --git a/patches/patches/45_optionals.patch b/patches/patches/45_optionals.patch new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/patches/patches/45_optionals.patch @@ -0,0 +1 @@ +