summaryrefslogtreecommitdiff
path: root/wk3/pset/runoff
diff options
context:
space:
mode:
Diffstat (limited to 'wk3/pset/runoff')
-rw-r--r--wk3/pset/runoff/runoff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wk3/pset/runoff/runoff.c b/wk3/pset/runoff/runoff.c
index a193adf..ae69ce3 100644
--- a/wk3/pset/runoff/runoff.c
+++ b/wk3/pset/runoff/runoff.c
@@ -7,7 +7,7 @@
#define MAX_CANDIDATES 9
// preferences[i][j] is jth preference for voter i
-string preferences[MAX_VOTERS][MAX_CANDIDATES];
+int preferences[MAX_VOTERS][MAX_CANDIDATES];
// Candidates have name, vote count, eliminated status
typedef struct
@@ -131,7 +131,7 @@ bool vote(int voter, int rank, string name)
{
if (!strcmp(name, candidates[i].name))
{
- preferences[voter][rank] = candidates[i].name;
+ preferences[voter][rank] = i;
return true;
}
}