-
Notifications
You must be signed in to change notification settings - Fork 0
/
role.c
60 lines (45 loc) · 785 Bytes
/
role.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <stdlib.h>
#include "role.h"
#include "ask.h"
const struct role roles[] = {
{ "Sysadmin",
{
"MCSA",
"",
"",
"",
"",
"BOFH",
"VAXorcist",
"UNIX Guru"
}
},
{ "Programmer",
{
"VB Coder",
"Computer Science Graduate",
"Real Programmer",
"Fledgling hacker",
"",
"",
"Regexp Ninja",
"Red Eye Knight"
}
}
};
int ask_role()
{
struct option role_opts[NUM_ROLES + 1];
unsigned int i;
for(i = 0; i < NUM_ROLES; i++) {
role_opts[i].letter = 0;
role_opts[i].text = roles[i].name;
}
role_opts[NUM_ROLES].text = NULL;
return ask_opt("Pick a role", role_opts);
}
const char *get_rank(unsigned int role, unsigned int rank)
{
if(role >= NUM_ROLES || rank > 7) return "";
return roles[role].rank[rank];
}