aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/exercises
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2023-08-02 23:39:59 +0200
committerGitHub <noreply@github.com>2023-08-02 23:39:59 +0200
commit2e5a49fc6886e6ca06714033d4ce1eb3090ef5a5 (patch)
tree8ef40d9961b8c3cd2197d17576d85919633ba6f0 /exercises
parentb5d54364cc3ee02ea7cccf4041476b16043eb206 (diff)
parent5a0681948baea7277b8d3418a4fe2ba134559559 (diff)
Merge pull request #346 from ratfactor/i339
changed struct name 'class' into 'role'
Diffstat (limited to 'exercises')
-rw-r--r--exercises/037_structs.zig8
-rw-r--r--exercises/038_structs2.zig8
2 files changed, 8 insertions, 8 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,
};
diff --git a/exercises/038_structs2.zig b/exercises/038_structs2.zig
index af7eb1f..b9d84aa 100644
--- a/exercises/038_structs2.zig
+++ b/exercises/038_structs2.zig
@@ -8,7 +8,7 @@
//
const std = @import("std");
-const Class = enum {
+const Role = enum {
wizard,
thief,
bard,
@@ -16,7 +16,7 @@ const Class = enum {
};
const Character = struct {
- class: Class,
+ role: Role,
gold: u32,
health: u8,
experience: u32,
@@ -27,7 +27,7 @@ pub fn main() void {
// Glorp the Wise
chars[0] = Character{
- .class = Class.wizard,
+ .role = Role.wizard,
.gold = 20,
.health = 100,
.experience = 10,
@@ -35,7 +35,7 @@ pub fn main() void {
// Please add "Zump the Loud" with the following properties:
//
- // class bard
+ // role bard
// gold 10
// health 100
// experience 20