aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/exercises/037_structs.zig
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2023-08-02 23:29:02 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2023-08-02 23:29:02 +0200
commit5a0681948baea7277b8d3418a4fe2ba134559559 (patch)
tree8ef40d9961b8c3cd2197d17576d85919633ba6f0 /exercises/037_structs.zig
parentb5d54364cc3ee02ea7cccf4041476b16043eb206 (diff)
changed struct name 'class' into 'role'
Diffstat (limited to 'exercises/037_structs.zig')
-rw-r--r--exercises/037_structs.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/037_structs.zig b/exercises/037_structs.zig
index 32f7b41..c345faf 100644
--- a/exercises/037_structs.zig
+++ b/exercises/037_structs.zig
@@ -22,8 +22,8 @@
//
const std = @import("std");
-// We'll use an enum to specify the character class.
-const Class = enum {
+// We'll use an enum to specify the character role.
+const Role = enum {
wizard,
thief,
bard,
@@ -33,7 +33,7 @@ const Class = enum {
// Please add a new property to this struct called "health" and make
// it a u8 integer type.
const Character = struct {
- class: Class,
+ role: Role,
gold: u32,
experience: u32,
};
@@ -41,7 +41,7 @@ const Character = struct {
pub fn main() void {
// Please initialize Glorp with 100 health.
var glorp_the_wise = Character{
- .class = Class.wizard,
+ .role = Role.wizard,
.gold = 20,
.experience = 10,
};