File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 2222//
2323const std = @import ("std" );
2424
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 {
2727 wizard ,
2828 thief ,
2929 bard ,
@@ -33,15 +33,15 @@ const Class = enum {
3333// Please add a new property to this struct called "health" and make
3434// it a u8 integer type.
3535const Character = struct {
36- class : Class ,
36+ role : Role ,
3737 gold : u32 ,
3838 experience : u32 ,
3939};
4040
4141pub fn main () void {
4242 // Please initialize Glorp with 100 health.
4343 var glorp_the_wise = Character {
44- .class = Class .wizard ,
44+ .role = Role .wizard ,
4545 .gold = 20 ,
4646 .experience = 10 ,
4747 };
Original file line number Diff line number Diff line change 88//
99const std = @import ("std" );
1010
11- const Class = enum {
11+ const Role = enum {
1212 wizard ,
1313 thief ,
1414 bard ,
1515 warrior ,
1616};
1717
1818const Character = struct {
19- class : Class ,
19+ role : Role ,
2020 gold : u32 ,
2121 health : u8 ,
2222 experience : u32 ,
@@ -27,15 +27,15 @@ pub fn main() void {
2727
2828 // Glorp the Wise
2929 chars [0 ] = Character {
30- .class = Class .wizard ,
30+ .role = Role .wizard ,
3131 .gold = 20 ,
3232 .health = 100 ,
3333 .experience = 10 ,
3434 };
3535
3636 // Please add "Zump the Loud" with the following properties:
3737 //
38- // class bard
38+ // role bard
3939 // gold 10
4040 // health 100
4141 // experience 20
Original file line number Diff line number Diff line change 1144a45,50
22> chars[1] = Character{
3- > .class = Class .bard,
3+ > .role = Role .bard,
44> .gold = 10,
55> .health = 100,
66> .experience = 20,
You can’t perform that action at this time.
0 commit comments