summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exercises/076_sentinels.zig4
-rw-r--r--exercises/077_sentinels2.zig2
-rw-r--r--exercises/078_sentinels3.zig2
-rw-r--r--exercises/079_quoted_identifiers.zig8
-rw-r--r--exercises/080_anonymous_structs.zig4
5 files changed, 10 insertions, 10 deletions
diff --git a/exercises/076_sentinels.zig b/exercises/076_sentinels.zig
index accb600..3ba6bf8 100644
--- a/exercises/076_sentinels.zig
+++ b/exercises/076_sentinels.zig
@@ -82,7 +82,7 @@ fn printSequence(my_seq: anytype) void {
print("Array:", .{});
// Loop through the items in my_seq.
- for (???) |s| {
+ for (my_seq) |s| {
print("{}", .{s});
}
},
@@ -94,7 +94,7 @@ fn printSequence(my_seq: anytype) void {
// Loop through the items in my_seq until we hit the
// sentinel value.
var i: usize = 0;
- while (??? != my_sentinel) {
+ while (my_seq[i] != my_sentinel) {
print("{}", .{my_seq[i]});
i += 1;
}
diff --git a/exercises/077_sentinels2.zig b/exercises/077_sentinels2.zig
index fb8f13d..c2fb54c 100644
--- a/exercises/077_sentinels2.zig
+++ b/exercises/077_sentinels2.zig
@@ -60,7 +60,7 @@ pub fn main() void {
// length... You've actually solved this problem before!
//
// Here's a big hint: do you remember how to take a slice?
- const printable = ???;
+ const printable = foo.data[0..foo.length];
print("{s}\n", .{printable});
}
diff --git a/exercises/078_sentinels3.zig b/exercises/078_sentinels3.zig
index 1e443e6..90b953f 100644
--- a/exercises/078_sentinels3.zig
+++ b/exercises/078_sentinels3.zig
@@ -21,7 +21,7 @@ pub fn main() void {
const data: [*]const u8 = "Weird Data!";
// Please cast 'data' to 'printable':
- const printable: [*:0]const u8 = ???;
+ const printable: [*:0]const u8 = @ptrCast(data);
print("{s}\n", .{printable});
}
diff --git a/exercises/079_quoted_identifiers.zig b/exercises/079_quoted_identifiers.zig
index 182c7ff..6abbe59 100644
--- a/exercises/079_quoted_identifiers.zig
+++ b/exercises/079_quoted_identifiers.zig
@@ -20,11 +20,11 @@
const print = @import("std").debug.print;
pub fn main() void {
- const 55_cows: i32 = 55;
- const isn't true: bool = false;
+ const @"55_cows": i32 = 55;
+ const @"isn't true": bool = false;
print("Sweet freedom: {}, {}.\n", .{
- 55_cows,
- isn't true,
+ @"55_cows",
+ @"isn't true",
});
}
diff --git a/exercises/080_anonymous_structs.zig b/exercises/080_anonymous_structs.zig
index 4e3ce84..b7d7641 100644
--- a/exercises/080_anonymous_structs.zig
+++ b/exercises/080_anonymous_structs.zig
@@ -48,13 +48,13 @@ pub fn main() void {
// * circle1 should hold i32 integers
// * circle2 should hold f32 floats
//
- const circle1 = ??? {
+ const circle1 = Circle(i32) {
.center_x = 25,
.center_y = 70,
.radius = 15,
};
- const circle2 = ??? {
+ const circle2 = Circle(f32) {
.center_x = 25.234,
.center_y = 70.999,
.radius = 15.714,