ziglings/exercises
mikkurogue de353bcb3b Update: 108 Labeled switch example to contain default case for exhaustion
Update example text to give clarity on default/exhaustive case.

Reasoning:
The input for the example will not compile if user would want to test this for the logic of a labeled switch. Due the input not being an exhaustive input but rather "any u8 integer" (for the lack of better terminology) we need to use the else branch to indicate that the default case is handled, in this case by just emulating the '4' branch, but this could return an error.InvalidCaseProvided for example.

Signed-off-by: mikkurogue <michael.lindemans@outlook.com>
2025-01-04 11:56:25 +00:00
..
001_hello.zig fix typo well -> will 2023-05-06 15:38:13 -06:00
002_std.zig Fix: Fix grammar at 002_std.zig 2021-08-19 08:59:18 -07:00
003_assignment.zig Replace "−" with "-" in Assigment 3 tutorial text 2022-06-04 17:21:34 -06:00
004_arrays.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
005_arrays2.zig Improve wording in 005 arrays2 for #93 2022-03-19 19:46:29 -04:00
006_strings.zig Revert syntax demo, add note 2022-02-22 02:21:22 +01:00
007_strings2.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
008_quiz.zig New usize explanation 008, etc. 2021-06-14 11:26:04 -04:00
009_if.zig fix: Change order to match 011_while.zig 2021-08-17 00:01:55 -07:00
010_if2.zig var to const when posssible 2023-06-22 09:41:41 +00:00
011_while.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
012_while2.zig add spaces 2022-02-11 10:40:22 +00:00
013_while3.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
014_while4.zig Normalize interrobangs 2021-05-09 13:15:53 -04:00
015_for.zig Updating wording in 'for' exercises 2023-04-30 16:23:35 -04:00
016_for2.zig Revised exercises due to the changes of Zig version 0.11.0-dev.3853 2023-06-26 23:43:39 +02:00
017_quiz2.zig var to const when posssible 2023-06-22 09:41:41 +00:00
018_functions.zig Update 018_functions.zig 2021-08-28 10:25:03 -04:00
019_functions2.zig adding enlightenment to 019 (for #50) 2021-04-26 20:45:19 -04:00
020_quiz3.zig adds missing 'the' to intro text 2023-02-16 00:39:56 +00:00
021_errors.zig use const for variables that are never modified 2022-01-01 02:20:26 +09:00
022_errors2.zig Normalized exercise output, answers (#41) 2021-04-04 16:29:28 -04:00
023_errors3.zig var to const when posssible 2023-06-22 09:41:41 +00:00
024_errors4.zig var to const when posssible 2023-06-22 09:41:41 +00:00
025_errors5.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
026_hello2.zig check for dev1650 and some minor polish 2023-02-19 17:52:16 +01:00
027_defer.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
028_defer2.zig Normalize interrobangs 2021-05-09 13:15:53 -04:00
029_errdefer.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
030_switch.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
031_switch2.zig var to const when posssible 2023-06-22 09:41:41 +00:00
032_unreachable.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
033_iferror.zig use const for variables that are never modified 2022-01-01 02:20:26 +09:00
034_quiz4.zig Update 034_quiz4.zig 2021-11-10 11:30:37 -05:00
035_enums.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
036_enums2.zig Update outdated comments 2023-06-22 12:11:24 +00:00
037_structs.zig changed struct name 'class' into 'role' 2023-08-02 23:29:02 +02:00
038_structs2.zig changed struct name 'class' into 'role' 2023-08-02 23:29:02 +02:00
039_pointers.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
040_pointers2.zig improving the explanation 2023-04-05 16:11:56 +02:00
041_pointers3.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
042_pointers4.zig Update 042_pointers4.zig 2023-01-12 19:25:06 +01:00
043_pointers5.zig Correct conventional Zig reference vs value passing re #89 2022-07-31 15:58:24 -04:00
044_quiz5.zig "999 is enough for anybody" triple-zero padding (#18) 2021-03-12 18:59:46 -05:00
045_optionals.zig var to const when posssible 2023-06-22 09:41:41 +00:00
046_optionals2.zig Deleted unnecessary pointer. 2024-11-08 22:48:37 +01:00
047_methods.zig the Earth 2024-05-20 21:32:32 +02:00
048_methods2.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
049_quiz6.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
050_no_value.zig Updated build version requirement to 0.10.0-dev.3385 2022-07-31 11:04:16 -04:00
051_values.zig Improved the explanation about passing arguments and added an example. 2024-03-14 23:37:14 +01:00
052_slices.zig Update 052_slices.zig 2021-08-30 17:55:32 -04:00
053_slices2.zig zig fmt 2021-11-05 17:47:12 +01:00
054_manypointers.zig Introduce syntax for turning a many pointer to a slice 2023-10-18 19:28:34 +00:00
055_unions.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
056_unions2.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
057_unions3.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
058_quiz7.zig Rephrase instruction for clarity 2024-10-26 20:43:47 +00:00
059_integers.zig Fixed unicode literal 2024-03-08 01:07:57 +01:00
060_floats.zig Change the task so that the exercise contains two errors again. 2023-11-06 19:50:47 +01:00
061_coercions.zig remove redundant word "a" 2021-12-25 15:21:33 -07:00
062_loop_expressions.zig fix loop else clause explanation 2022-04-22 17:50:10 -07:00
063_labels.zig dev.1711 - switched to multi-object-for-loops 2023-02-21 21:43:40 +01:00
064_builtins.zig Fix two minor typos 2023-11-21 19:09:47 +02:00
065_builtins2.zig Improved maximumNarcissism 2024-11-02 17:03:46 +01:00
066_comptime.zig description specified 2023-01-29 17:52:11 +01:00
067_comptime2.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
068_comptime3.zig Fixed missing comptime. 2023-06-11 23:41:42 +02:00
069_comptime4.zig Revised exercises due to the changes of Zig version 0.11.0-dev.3853 2023-06-26 23:43:39 +02:00
070_comptime5.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
071_comptime6.zig Fixes several changes in std.builtin.zig 2024-09-02 19:33:59 +02:00
072_comptime7.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
073_comptime8.zig fix whitespace line-endings 2021-11-05 17:46:56 +01:00
074_comptime9.zig Global scope is container-level scope 2023-09-20 22:30:57 +00:00
075_quiz8.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
076_sentinels.zig Fixes several changes in std.builtin.zig 2024-09-02 19:33:59 +02:00
077_sentinels2.zig zig fmt 2021-11-05 17:47:12 +01:00
078_sentinels3.zig Update 078_sentinels3.zig 2023-06-29 21:32:44 +02:00
079_quoted_identifiers.zig Remove trailing whitespace. 2022-05-18 21:39:36 +02:00
080_anonymous_structs.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
081_anonymous_structs2.zig Fix exercises 058 and 081 🔧 2021-09-04 19:00:03 +03:00
082_anonymous_structs3.zig Corrects the description of the new @typeInfo().@"struct".fields 2024-09-07 19:21:57 +02:00
083_anonymous_lists.zig Ensure the exercises use the canonical format 2023-04-18 18:16:19 +02:00
084_async.zig fix whitespace line-endings 2021-11-05 17:46:56 +01:00
085_async2.zig fix whitespace line-endings 2021-11-05 17:46:56 +01:00
086_async3.zig change suspend; to suspend {} 2021-05-24 15:57:59 -04:00
087_async4.zig add ex087 async 4 2021-05-12 21:36:57 -04:00
088_async5.zig No unused fn params 2021-06-30 19:59:25 -04:00
089_async6.zig zig fmt 2021-11-05 17:47:12 +01:00
090_async7.zig fix whitespace line-endings 2021-11-05 17:46:56 +01:00
091_async8.zig Added ex91 - closing in on async! 2021-11-07 20:51:33 -05:00
092_interfaces.zig Converted var to const if there is no mutation in var. 2023-11-21 15:01:22 +01:00
093_hello_c.zig Update exercises/093_hello_c.zig 2024-01-13 14:27:58 +00:00
094_c_math.zig fix: typo: % instead of @ for a builtin function 2024-05-04 18:51:00 +02:00
095_for3.zig Clarification in description for ranges in loops. 2024-08-11 16:29:14 +02:00
096_memory_allocation.zig Fix some typos 2024-05-06 09:13:56 +02:00
097_bit_manipulation.zig Fix some typos 2024-05-06 09:13:56 +02:00
098_bit_manipulation2.zig Fix some typos 2024-05-06 09:13:56 +02:00
099_formatting.zig Fixed link to format source code. 2024-11-07 21:45:47 +01:00
100_for4.zig Added Ex. 100 fourth for (as foretold in #261) 2023-04-30 21:23:54 -04:00
101_for5.zig Add link to DoD talk in 101_for5.zig 2023-08-17 19:43:13 +02:00
102_testing.zig Added testing exercise. 2023-05-15 00:06:15 +02:00
103_tokenization.zig Fixed error message through a TAB in the comment, see https://github.com/ziglang/zig/issues/20928 2024-08-04 14:19:05 +02:00
104_threading.zig Fix some typos 2024-05-06 09:13:56 +02:00
105_threading2.zig Added missing space after a sentence. 2024-11-07 22:05:00 +01:00
106_files.zig Minor case-related changes. 2024-11-08 13:29:44 +01:00
107_files2.zig English fixes for 107_files2.zig 2024-06-12 17:29:11 +10:00
108_labeled_switch.zig Update: 108 Labeled switch example to contain default case for exhaustion 2025-01-04 11:56:25 +00:00
109_vectors.zig Fixed formating, created patch file. 2024-11-07 15:01:59 +01:00
999_the_end.zig changed 'the_end' to '999_the_end' 2023-01-22 13:12:53 +01:00