File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 22
22
//
23
23
const std = @import ("std" );
24
24
25
- // We'll use an enum to specify the character class .
26
- const Class = enum {
25
+ // We'll use an enum to specify the character role .
26
+ const Role = enum {
27
27
wizard ,
28
28
thief ,
29
29
bard ,
@@ -33,15 +33,15 @@ const Class = enum {
33
33
// Please add a new property to this struct called "health" and make
34
34
// it a u8 integer type.
35
35
const Character = struct {
36
- class : Class ,
36
+ role : Role ,
37
37
gold : u32 ,
38
38
experience : u32 ,
39
39
};
40
40
41
41
pub fn main () void {
42
42
// Please initialize Glorp with 100 health.
43
43
var glorp_the_wise = Character {
44
- .class = Class .wizard ,
44
+ .role = Role .wizard ,
45
45
.gold = 20 ,
46
46
.experience = 10 ,
47
47
};
Original file line number Diff line number Diff line change 8
8
//
9
9
const std = @import ("std" );
10
10
11
- const Class = enum {
11
+ const Role = enum {
12
12
wizard ,
13
13
thief ,
14
14
bard ,
15
15
warrior ,
16
16
};
17
17
18
18
const Character = struct {
19
- class : Class ,
19
+ role : Role ,
20
20
gold : u32 ,
21
21
health : u8 ,
22
22
experience : u32 ,
@@ -27,15 +27,15 @@ pub fn main() void {
27
27
28
28
// Glorp the Wise
29
29
chars [0 ] = Character {
30
- .class = Class .wizard ,
30
+ .role = Role .wizard ,
31
31
.gold = 20 ,
32
32
.health = 100 ,
33
33
.experience = 10 ,
34
34
};
35
35
36
36
// Please add "Zump the Loud" with the following properties:
37
37
//
38
- // class bard
38
+ // role bard
39
39
// gold 10
40
40
// health 100
41
41
// experience 20
Original file line number Diff line number Diff line change 1
1
44a45,50
2
2
> chars[1] = Character{
3
- > .class = Class .bard,
3
+ > .role = Role .bard,
4
4
> .gold = 10,
5
5
> .health = 100,
6
6
> .experience = 20,
You can’t perform that action at this time.
0 commit comments