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 @@ +