diff options
| author | Ibrahim Muftee <ibrahim@muftee.net> | 2026-06-29 15:11:40 -0500 |
|---|---|---|
| committer | Ibrahim Muftee <ibrahim@muftee.net> | 2026-06-29 15:15:14 -0500 |
| commit | bdfe3df2947f8787c8a4ef8c534f6a8932e13871 (patch) | |
| tree | f2df9a5f56b6c7f95c0978a861cb0ecf60560391 /exercises/065_builtins2.zig | |
| parent | d093f37e1e4c5aed4a4c8d4999001134aec251ca (diff) | |
feat: begin solving exercises
Diffstat (limited to 'exercises/065_builtins2.zig')
| -rw-r--r-- | exercises/065_builtins2.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/exercises/065_builtins2.zig b/exercises/065_builtins2.zig index 9d137ef..2c29bdb 100644 --- a/exercises/065_builtins2.zig +++ b/exercises/065_builtins2.zig @@ -58,7 +58,7 @@ pub fn main() void { // Oops! We cannot leave the 'me' and 'myself' fields // undefined. Please set them here: narcissus.me = &narcissus; - narcissus.??? = ???; + narcissus.myself = &narcissus; // This determines a "peer type" from three separate // references (they just happen to all be the same object). @@ -70,7 +70,7 @@ pub fn main() void { // // The fix for this is very subtle, but it makes a big // difference! - const Type2 = narcissus.FetchTheMostBeautifulType(); + const Type2 = Narcissus.FetchTheMostBeautifulType(); // Now we print a pithy statement about Narcissus. print("A {s} loves all {s}es. ", .{ @@ -102,16 +102,16 @@ pub fn main() void { // Please complete these 'if' statements so that the field // name will not be printed if the field is of type 'void' // (which is a zero-bit type that takes up no space at all!): - if (field_???[???] != void) { - print(" {s}", .{field_???[???]}); + if (field_types[0] != void) { + print(" {s}", .{field_names[0]}); } - if (field_???[???] != void) { - print(" {s}", .{field_???[???]}); + if (field_types[1] != void) { + print(" {s}", .{field_names[1]}); } - if (field_???[???] != void) { - print(" {s}", .{field_???[???]}); + if (field_types[2] != void) { + print(" {s}", .{field_names[2]}); } // Yuck, look at all that repeated code above! I don't know |
