Просмотр исходного кода

Patches to patches to clean up patches

Dave Gauer 4 лет назад
Родитель
Сommit
ca330b00bc
49 измененных файлов с 8 добавлено и 9 удалено
  1. 0 4
      patches/45_optionals.patch
  2. 1 1
      patches/README.md
  3. 5 3
      patches/eowyn.sh
  4. 1 1
      patches/gollum.sh
  5. 0 0
      patches/patches/01_hello.patch
  6. 0 0
      patches/patches/02_std.patch
  7. 0 0
      patches/patches/03_assignment.patch
  8. 0 0
      patches/patches/04_arrays.patch
  9. 0 0
      patches/patches/05_arrays2.patch
  10. 0 0
      patches/patches/06_strings.patch
  11. 0 0
      patches/patches/07_strings2.patch
  12. 0 0
      patches/patches/08_quiz.patch
  13. 0 0
      patches/patches/09_if.patch
  14. 0 0
      patches/patches/10_if2.patch
  15. 0 0
      patches/patches/11_while.patch
  16. 0 0
      patches/patches/12_while2.patch
  17. 0 0
      patches/patches/13_while3.patch
  18. 0 0
      patches/patches/14_while4.patch
  19. 0 0
      patches/patches/15_for.patch
  20. 0 0
      patches/patches/16_for2.patch
  21. 0 0
      patches/patches/17_quiz2.patch
  22. 0 0
      patches/patches/18_functions.patch
  23. 0 0
      patches/patches/19_functions2.patch
  24. 0 0
      patches/patches/20_quiz3.patch
  25. 0 0
      patches/patches/21_errors.patch
  26. 0 0
      patches/patches/22_errors2.patch
  27. 0 0
      patches/patches/23_errors3.patch
  28. 0 0
      patches/patches/24_errors4.patch
  29. 0 0
      patches/patches/25_errors5.patch
  30. 0 0
      patches/patches/26_hello2.patch
  31. 0 0
      patches/patches/27_defer.patch
  32. 0 0
      patches/patches/28_defer2.patch
  33. 0 0
      patches/patches/29_errdefer.patch
  34. 0 0
      patches/patches/30_switch.patch
  35. 0 0
      patches/patches/31_switch2.patch
  36. 0 0
      patches/patches/32_unreachable.patch
  37. 0 0
      patches/patches/33_iferror.patch
  38. 0 0
      patches/patches/34_quiz4.patch
  39. 0 0
      patches/patches/35_enums.patch
  40. 0 0
      patches/patches/36_enums2.patch
  41. 0 0
      patches/patches/37_structs.patch
  42. 0 0
      patches/patches/38_structs2.patch
  43. 0 0
      patches/patches/39_pointers.patch
  44. 0 0
      patches/patches/40_pointers2.patch
  45. 0 0
      patches/patches/41_pointers3.patch
  46. 0 0
      patches/patches/42_pointers4.patch
  47. 0 0
      patches/patches/43_pointers5.patch
  48. 0 0
      patches/patches/44_quiz5.patch
  49. 1 0
      patches/patches/45_optionals.patch

+ 0 - 4
patches/45_optionals.patch

@@ -1,4 +0,0 @@
-32c32
-<     var answer: u8 = result;
----
->     var answer: u8 = result orelse 42;

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

+ 5 - 3
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
 

+ 1 - 1
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"
 

+ 0 - 0
patches/01_hello.patch → patches/patches/01_hello.patch


+ 0 - 0
patches/02_std.patch → patches/patches/02_std.patch


+ 0 - 0
patches/03_assignment.patch → patches/patches/03_assignment.patch


+ 0 - 0
patches/04_arrays.patch → patches/patches/04_arrays.patch


+ 0 - 0
patches/05_arrays2.patch → patches/patches/05_arrays2.patch


+ 0 - 0
patches/06_strings.patch → patches/patches/06_strings.patch


+ 0 - 0
patches/07_strings2.patch → patches/patches/07_strings2.patch


+ 0 - 0
patches/08_quiz.patch → patches/patches/08_quiz.patch


+ 0 - 0
patches/09_if.patch → patches/patches/09_if.patch


+ 0 - 0
patches/10_if2.patch → patches/patches/10_if2.patch


+ 0 - 0
patches/11_while.patch → patches/patches/11_while.patch


+ 0 - 0
patches/12_while2.patch → patches/patches/12_while2.patch


+ 0 - 0
patches/13_while3.patch → patches/patches/13_while3.patch


+ 0 - 0
patches/14_while4.patch → patches/patches/14_while4.patch


+ 0 - 0
patches/15_for.patch → patches/patches/15_for.patch


+ 0 - 0
patches/16_for2.patch → patches/patches/16_for2.patch


+ 0 - 0
patches/17_quiz2.patch → patches/patches/17_quiz2.patch


+ 0 - 0
patches/18_functions.patch → patches/patches/18_functions.patch


+ 0 - 0
patches/19_functions2.patch → patches/patches/19_functions2.patch


+ 0 - 0
patches/20_quiz3.patch → patches/patches/20_quiz3.patch


+ 0 - 0
patches/21_errors.patch → patches/patches/21_errors.patch


+ 0 - 0
patches/22_errors2.patch → patches/patches/22_errors2.patch


+ 0 - 0
patches/23_errors3.patch → patches/patches/23_errors3.patch


+ 0 - 0
patches/24_errors4.patch → patches/patches/24_errors4.patch


+ 0 - 0
patches/25_errors5.patch → patches/patches/25_errors5.patch


+ 0 - 0
patches/26_hello2.patch → patches/patches/26_hello2.patch


+ 0 - 0
patches/27_defer.patch → patches/patches/27_defer.patch


+ 0 - 0
patches/28_defer2.patch → patches/patches/28_defer2.patch


+ 0 - 0
patches/29_errdefer.patch → patches/patches/29_errdefer.patch


+ 0 - 0
patches/30_switch.patch → patches/patches/30_switch.patch


+ 0 - 0
patches/31_switch2.patch → patches/patches/31_switch2.patch


+ 0 - 0
patches/32_unreachable.patch → patches/patches/32_unreachable.patch


+ 0 - 0
patches/33_iferror.patch → patches/patches/33_iferror.patch


+ 0 - 0
patches/34_quiz4.patch → patches/patches/34_quiz4.patch


+ 0 - 0
patches/35_enums.patch → patches/patches/35_enums.patch


+ 0 - 0
patches/36_enums2.patch → patches/patches/36_enums2.patch


+ 0 - 0
patches/37_structs.patch → patches/patches/37_structs.patch


+ 0 - 0
patches/38_structs2.patch → patches/patches/38_structs2.patch


+ 0 - 0
patches/39_pointers.patch → patches/patches/39_pointers.patch


+ 0 - 0
patches/40_pointers2.patch → patches/patches/40_pointers2.patch


+ 0 - 0
patches/41_pointers3.patch → patches/patches/41_pointers3.patch


+ 0 - 0
patches/42_pointers4.patch → patches/patches/42_pointers4.patch


+ 0 - 0
patches/43_pointers5.patch → patches/patches/43_pointers5.patch


+ 0 - 0
patches/44_quiz5.patch → patches/patches/44_quiz5.patch


+ 1 - 0
patches/patches/45_optionals.patch

@@ -0,0 +1 @@
+