aboutsummaryrefslogtreecommitdiff
path: root/exercises/006_strings.zig
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2022-12-09 22:07:01 +0000
committerMartin Ashby <martin@ashbysoft.com>2022-12-09 22:07:01 +0000
commit0e447c7956410a993614f9337d6219e017722443 (patch)
treec12780891cbbd14b52695df1fe336cc8981de6d9 /exercises/006_strings.zig
parentbb5b8f115a57fc8c85ac7344fe4dc0b796e32487 (diff)
downloadziglings-0e447c7956410a993614f9337d6219e017722443.tar.gz
ziglings-0e447c7956410a993614f9337d6219e017722443.tar.bz2
ziglings-0e447c7956410a993614f9337d6219e017722443.tar.xz
ziglings-0e447c7956410a993614f9337d6219e017722443.zip
001-024 complete
Diffstat (limited to 'exercises/006_strings.zig')
-rw-r--r--exercises/006_strings.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/exercises/006_strings.zig b/exercises/006_strings.zig
index 5a7172c..3ad26ce 100644
--- a/exercises/006_strings.zig
+++ b/exercises/006_strings.zig
@@ -24,18 +24,18 @@ pub fn main() void {
// (Problem 1)
// Use array square bracket syntax to get the letter 'd' from
// the string "stardust" above.
- const d: u8 = ziggy[???];
+ const d: u8 = ziggy[4];
// (Problem 2)
// Use the array repeat '**' operator to make "ha ha ha ".
- const laugh = "ha " ???;
+ const laugh = "ha " ** 3;
// (Problem 3)
// Use the array concatenation '++' operator to make "Major Tom".
// (You'll need to add a space as well!)
const major = "Major";
const tom = "Tom";
- const major_tom = major ??? tom;
+ const major_tom = major ++ " " ++ tom;
// That's all the problems. Let's see our results:
std.debug.print("d={u} {s}{s}\n", .{ d, laugh, major_tom });