From 55ad7c32f2d534b1fbd438204d21738f958c51a5 Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Tue, 9 Feb 2021 18:36:57 -0500 Subject: [PATCH] Moved exercises to exercises because exercises --- README.md | 4 ++-- 01_hello.zig => exercises/01_hello.zig | 0 02_std.zig => exercises/02_std.zig | 0 03_assignment.zig => exercises/03_assignment.zig | 0 04_arrays.zig => exercises/04_arrays.zig | 0 05_arrays2.zig => exercises/05_arrays2.zig | 0 06_strings.zig => exercises/06_strings.zig | 0 07_strings2.zig => exercises/07_strings2.zig | 0 08_quiz.zig => exercises/08_quiz.zig | 0 09_if.zig => exercises/09_if.zig | 0 10_if2.zig => exercises/10_if2.zig | 0 11_while.zig => exercises/11_while.zig | 0 12_while2.zig => exercises/12_while2.zig | 0 13_while3.zig => exercises/13_while3.zig | 0 14_while4.zig => exercises/14_while4.zig | 0 15_for.zig => exercises/15_for.zig | 0 16_for2.zig => exercises/16_for2.zig | 0 17_quiz2.zig => exercises/17_quiz2.zig | 0 18_functions.zig => exercises/18_functions.zig | 0 19_functions2.zig => exercises/19_functions2.zig | 0 20_quiz3.zig => exercises/20_quiz3.zig | 0 21_errors.zig => exercises/21_errors.zig | 0 22_errors2.zig => exercises/22_errors2.zig | 0 23_errors3.zig => exercises/23_errors3.zig | 0 24_errors4.zig => exercises/24_errors4.zig | 0 25_errors5.zig => exercises/25_errors5.zig | 0 26_hello2.zig => exercises/26_hello2.zig | 0 27_defer.zig => exercises/27_defer.zig | 0 28_defer2.zig => exercises/28_defer2.zig | 0 29_errdefer.zig => exercises/29_errdefer.zig | 0 30_switch.zig => exercises/30_switch.zig | 0 31_switch2.zig => exercises/31_switch2.zig | 0 32_unreachable.zig => exercises/32_unreachable.zig | 0 33_iferror.zig => exercises/33_iferror.zig | 0 34_quiz4.zig => exercises/34_quiz4.zig | 0 35_enums.zig => exercises/35_enums.zig | 0 36_enums2.zig => exercises/36_enums2.zig | 0 37_structs.zig => exercises/37_structs.zig | 0 38_structs2.zig => exercises/38_structs2.zig | 0 39_pointers.zig => exercises/39_pointers.zig | 0 40_pointers2.zig => exercises/40_pointers2.zig | 0 41_pointers3.zig => exercises/41_pointers3.zig | 0 42_pointers4.zig => exercises/42_pointers4.zig | 0 43_pointers5.zig => exercises/43_pointers5.zig | 0 ziglings | 2 +- 45 files changed, 3 insertions(+), 3 deletions(-) rename 01_hello.zig => exercises/01_hello.zig (100%) rename 02_std.zig => exercises/02_std.zig (100%) rename 03_assignment.zig => exercises/03_assignment.zig (100%) rename 04_arrays.zig => exercises/04_arrays.zig (100%) rename 05_arrays2.zig => exercises/05_arrays2.zig (100%) rename 06_strings.zig => exercises/06_strings.zig (100%) rename 07_strings2.zig => exercises/07_strings2.zig (100%) rename 08_quiz.zig => exercises/08_quiz.zig (100%) rename 09_if.zig => exercises/09_if.zig (100%) rename 10_if2.zig => exercises/10_if2.zig (100%) rename 11_while.zig => exercises/11_while.zig (100%) rename 12_while2.zig => exercises/12_while2.zig (100%) rename 13_while3.zig => exercises/13_while3.zig (100%) rename 14_while4.zig => exercises/14_while4.zig (100%) rename 15_for.zig => exercises/15_for.zig (100%) rename 16_for2.zig => exercises/16_for2.zig (100%) rename 17_quiz2.zig => exercises/17_quiz2.zig (100%) rename 18_functions.zig => exercises/18_functions.zig (100%) rename 19_functions2.zig => exercises/19_functions2.zig (100%) rename 20_quiz3.zig => exercises/20_quiz3.zig (100%) rename 21_errors.zig => exercises/21_errors.zig (100%) rename 22_errors2.zig => exercises/22_errors2.zig (100%) rename 23_errors3.zig => exercises/23_errors3.zig (100%) rename 24_errors4.zig => exercises/24_errors4.zig (100%) rename 25_errors5.zig => exercises/25_errors5.zig (100%) rename 26_hello2.zig => exercises/26_hello2.zig (100%) rename 27_defer.zig => exercises/27_defer.zig (100%) rename 28_defer2.zig => exercises/28_defer2.zig (100%) rename 29_errdefer.zig => exercises/29_errdefer.zig (100%) rename 30_switch.zig => exercises/30_switch.zig (100%) rename 31_switch2.zig => exercises/31_switch2.zig (100%) rename 32_unreachable.zig => exercises/32_unreachable.zig (100%) rename 33_iferror.zig => exercises/33_iferror.zig (100%) rename 34_quiz4.zig => exercises/34_quiz4.zig (100%) rename 35_enums.zig => exercises/35_enums.zig (100%) rename 36_enums2.zig => exercises/36_enums2.zig (100%) rename 37_structs.zig => exercises/37_structs.zig (100%) rename 38_structs2.zig => exercises/38_structs2.zig (100%) rename 39_pointers.zig => exercises/39_pointers.zig (100%) rename 40_pointers2.zig => exercises/40_pointers2.zig (100%) rename 41_pointers3.zig => exercises/41_pointers3.zig (100%) rename 42_pointers4.zig => exercises/42_pointers4.zig (100%) rename 43_pointers5.zig => exercises/43_pointers5.zig (100%) diff --git a/README.md b/README.md index 880b385..69287dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # ziglings -Welcome to `ziglings`. This project contains a series of incomplete exercises. +Welcome to `ziglings`! This project contains a series of incomplete exercises. By completing the exercises, you learn how to read and write [Zig](https://ziglang.org/) code. @@ -55,7 +55,7 @@ If you can't (or don't want to) use the script, you can manually verify each exercise with the Zig compiler: ```bash -zig run 01_hello.zig +zig run exercises/01_hello.zig ``` ## TODO diff --git a/01_hello.zig b/exercises/01_hello.zig similarity index 100% rename from 01_hello.zig rename to exercises/01_hello.zig diff --git a/02_std.zig b/exercises/02_std.zig similarity index 100% rename from 02_std.zig rename to exercises/02_std.zig diff --git a/03_assignment.zig b/exercises/03_assignment.zig similarity index 100% rename from 03_assignment.zig rename to exercises/03_assignment.zig diff --git a/04_arrays.zig b/exercises/04_arrays.zig similarity index 100% rename from 04_arrays.zig rename to exercises/04_arrays.zig diff --git a/05_arrays2.zig b/exercises/05_arrays2.zig similarity index 100% rename from 05_arrays2.zig rename to exercises/05_arrays2.zig diff --git a/06_strings.zig b/exercises/06_strings.zig similarity index 100% rename from 06_strings.zig rename to exercises/06_strings.zig diff --git a/07_strings2.zig b/exercises/07_strings2.zig similarity index 100% rename from 07_strings2.zig rename to exercises/07_strings2.zig diff --git a/08_quiz.zig b/exercises/08_quiz.zig similarity index 100% rename from 08_quiz.zig rename to exercises/08_quiz.zig diff --git a/09_if.zig b/exercises/09_if.zig similarity index 100% rename from 09_if.zig rename to exercises/09_if.zig diff --git a/10_if2.zig b/exercises/10_if2.zig similarity index 100% rename from 10_if2.zig rename to exercises/10_if2.zig diff --git a/11_while.zig b/exercises/11_while.zig similarity index 100% rename from 11_while.zig rename to exercises/11_while.zig diff --git a/12_while2.zig b/exercises/12_while2.zig similarity index 100% rename from 12_while2.zig rename to exercises/12_while2.zig diff --git a/13_while3.zig b/exercises/13_while3.zig similarity index 100% rename from 13_while3.zig rename to exercises/13_while3.zig diff --git a/14_while4.zig b/exercises/14_while4.zig similarity index 100% rename from 14_while4.zig rename to exercises/14_while4.zig diff --git a/15_for.zig b/exercises/15_for.zig similarity index 100% rename from 15_for.zig rename to exercises/15_for.zig diff --git a/16_for2.zig b/exercises/16_for2.zig similarity index 100% rename from 16_for2.zig rename to exercises/16_for2.zig diff --git a/17_quiz2.zig b/exercises/17_quiz2.zig similarity index 100% rename from 17_quiz2.zig rename to exercises/17_quiz2.zig diff --git a/18_functions.zig b/exercises/18_functions.zig similarity index 100% rename from 18_functions.zig rename to exercises/18_functions.zig diff --git a/19_functions2.zig b/exercises/19_functions2.zig similarity index 100% rename from 19_functions2.zig rename to exercises/19_functions2.zig diff --git a/20_quiz3.zig b/exercises/20_quiz3.zig similarity index 100% rename from 20_quiz3.zig rename to exercises/20_quiz3.zig diff --git a/21_errors.zig b/exercises/21_errors.zig similarity index 100% rename from 21_errors.zig rename to exercises/21_errors.zig diff --git a/22_errors2.zig b/exercises/22_errors2.zig similarity index 100% rename from 22_errors2.zig rename to exercises/22_errors2.zig diff --git a/23_errors3.zig b/exercises/23_errors3.zig similarity index 100% rename from 23_errors3.zig rename to exercises/23_errors3.zig diff --git a/24_errors4.zig b/exercises/24_errors4.zig similarity index 100% rename from 24_errors4.zig rename to exercises/24_errors4.zig diff --git a/25_errors5.zig b/exercises/25_errors5.zig similarity index 100% rename from 25_errors5.zig rename to exercises/25_errors5.zig diff --git a/26_hello2.zig b/exercises/26_hello2.zig similarity index 100% rename from 26_hello2.zig rename to exercises/26_hello2.zig diff --git a/27_defer.zig b/exercises/27_defer.zig similarity index 100% rename from 27_defer.zig rename to exercises/27_defer.zig diff --git a/28_defer2.zig b/exercises/28_defer2.zig similarity index 100% rename from 28_defer2.zig rename to exercises/28_defer2.zig diff --git a/29_errdefer.zig b/exercises/29_errdefer.zig similarity index 100% rename from 29_errdefer.zig rename to exercises/29_errdefer.zig diff --git a/30_switch.zig b/exercises/30_switch.zig similarity index 100% rename from 30_switch.zig rename to exercises/30_switch.zig diff --git a/31_switch2.zig b/exercises/31_switch2.zig similarity index 100% rename from 31_switch2.zig rename to exercises/31_switch2.zig diff --git a/32_unreachable.zig b/exercises/32_unreachable.zig similarity index 100% rename from 32_unreachable.zig rename to exercises/32_unreachable.zig diff --git a/33_iferror.zig b/exercises/33_iferror.zig similarity index 100% rename from 33_iferror.zig rename to exercises/33_iferror.zig diff --git a/34_quiz4.zig b/exercises/34_quiz4.zig similarity index 100% rename from 34_quiz4.zig rename to exercises/34_quiz4.zig diff --git a/35_enums.zig b/exercises/35_enums.zig similarity index 100% rename from 35_enums.zig rename to exercises/35_enums.zig diff --git a/36_enums2.zig b/exercises/36_enums2.zig similarity index 100% rename from 36_enums2.zig rename to exercises/36_enums2.zig diff --git a/37_structs.zig b/exercises/37_structs.zig similarity index 100% rename from 37_structs.zig rename to exercises/37_structs.zig diff --git a/38_structs2.zig b/exercises/38_structs2.zig similarity index 100% rename from 38_structs2.zig rename to exercises/38_structs2.zig diff --git a/39_pointers.zig b/exercises/39_pointers.zig similarity index 100% rename from 39_pointers.zig rename to exercises/39_pointers.zig diff --git a/40_pointers2.zig b/exercises/40_pointers2.zig similarity index 100% rename from 40_pointers2.zig rename to exercises/40_pointers2.zig diff --git a/41_pointers3.zig b/exercises/41_pointers3.zig similarity index 100% rename from 41_pointers3.zig rename to exercises/41_pointers3.zig diff --git a/42_pointers4.zig b/exercises/42_pointers4.zig similarity index 100% rename from 42_pointers4.zig rename to exercises/42_pointers4.zig diff --git a/43_pointers5.zig b/exercises/43_pointers5.zig similarity index 100% rename from 43_pointers5.zig rename to exercises/43_pointers5.zig diff --git a/ziglings b/ziglings index 402d867..2692657 100755 --- a/ziglings +++ b/ziglings @@ -20,7 +20,7 @@ fmt_off=$( tput sgr0 ) # reset colors/effects exercise_num=0 function check_it { - source_file=$1 + source_file="exercises/$1" correct_output=$2 hint=$3