summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2023-08-17 15:03:17 +0200
committerGitHub <noreply@github.com>2023-08-17 15:03:17 +0200
commit92a4f3acf88db860a170df67b4b93caab41928b3 (patch)
tree2f3526d8f7d78201ca590f2aca2b74cf2422b550
parent2e5a49fc6886e6ca06714033d4ce1eb3090ef5a5 (diff)
parent4eb949759be1ec16cf371bc3f6b1b28ac15abb3b (diff)
Merge pull request #351 from ratfactor/class_role
changed struct name 'class' into 'role'
-rw-r--r--exercises/101_for5.zig12
-rw-r--r--patches/patches/101_for5.patch4
2 files changed, 8 insertions, 8 deletions
diff --git a/exercises/101_for5.zig b/exercises/101_for5.zig
index 037989f..234cc4f 100644
--- a/exercises/101_for5.zig
+++ b/exercises/101_for5.zig
@@ -35,8 +35,8 @@
const std = @import("std");
const print = std.debug.print;
-// This is the same character class enum we've seen before.
-const Class = enum {
+// This is the same character role enum we've seen before.
+const Role = enum {
wizard,
thief,
bard,
@@ -45,14 +45,14 @@ const Class = enum {
pub fn main() void {
// Here are the three "property" arrays:
- const classes = [4]Class{ .wizard, .bard, .bard, .warrior };
+ const roles = [4]Role{ .wizard, .bard, .bard, .warrior };
const gold = [4]u16{ 25, 11, 5, 7392 };
const experience = [4]u8{ 40, 17, 55, 21 };
// We would like to number our list starting with 1, not 0.
// How do we do that?
- for (classes, gold, experience, ???) |c, g, e, i| {
- const class_name = switch (c) {
+ for (roles, gold, experience, ???) |c, g, e, i| {
+ const role_name = switch (c) {
.wizard => "Wizard",
.thief => "Thief",
.bard => "Bard",
@@ -61,7 +61,7 @@ pub fn main() void {
std.debug.print("{d}. {s} (Gold: {d}, XP: {d})\n", .{
i,
- class_name,
+ role_name,
g,
e,
});
diff --git a/patches/patches/101_for5.patch b/patches/patches/101_for5.patch
index 0466cc8..edb927f 100644
--- a/patches/patches/101_for5.patch
+++ b/patches/patches/101_for5.patch
@@ -1,4 +1,4 @@
54c54
-< for (classes, gold, experience, ???) |c, g, e, i| {
+< for (roles, gold, experience, ???) |c, g, e, i| {
---
-> for (classes, gold, experience, 1..) |c, g, e, i| {
+> for (roles, gold, experience, 1..) |c, g, e, i| {