Update on my code: I’ve found a very bad error in it. When I updated it from the previous game, I neglected to update the number of players in one of the loops. Where the code I posted before had
for(i=0;i<8;i++) {
if(players* == 1) n_scum++; /* Count the number of Scum */
}
it should say
for(i=0;i<13;i++) {
if(players* == 1) n_scum++; /* Count the number of Scum */
}
The net effect of this error was to increase everyone’s scores, but especially those of Zeriel, ShadowFacts, Jimmy Chitwood, storyteller, and cardinal_fang. I have now fixed this mistake. Ignore all previous output I posted from my program, as it is completely incorrect.
In addition, I have made further refinements to my method. Previously, I was making an assumption as to how much Scum were voting for other Scum, and discarding any cases which did not match that pre-set assumption. I am now instead, in each case, counting how many times Town voted for Scum, and comparing that number (relatively speaking) to the number of times that Scum voted for Scum. In other words, I assume that the average Townie was more likely to have voted for Scum than the average Scum was. This not only removes the need for one of my assumptions, but also allows a way for my program to listen to the suspicions of the genuine Town, whomever they may be. I believe that this means that the results are now not only less subjective, but more accurate.
With this change, I have also removed the counting of “un-buses”, where a Scum votes for another Scum’s rival, to save a teammate, as I believe that this information is included in the information about Town’s voting patterns.
I have also restructured the main loop of the program. Whereas before it cycled through all of the possibilities through the use of 13 nested loops, it now uses a single loop on a single integer, with each bit of the integer representing a player. Theoretically, this shouldn’t make any difference to the running of the program, but it’ll make it easier to adapt to other games in the future, and also appears to have fixed the bug with Telcontar’s name.
Here’s the new and improved program:
[noparse]#include <stdio.h>
#define n_players 13 /* Number of players under analysis */
#define max_scum 4 /* Maximum expected number of Scum */
#define min_scum 4 /* Minimum expected number of Scum */
#define town_votes 21 /* Number of Town votes cast so far */
#define scum_votes 8 /* Number of Scum votes cast so far */
main()
{
int players[n_players]; /* Stores the alignment of each player. 0 = Town, 1 = Scum */
unsigned int players_binary;
unsigned int players_binary_shifting;
char names[n_players][20] = {"Telcontar", "AllWalker", "Chronos", "Imaginary Fiend", "Meeko", "USCDiver", "pedescribe", "Scuba Ben", "Zeriel", "ShadowFacts", "Jimmy Chitwood", "storyteller", "cardinal_fang"};
int n_scum;
int buses; /* Number of times Scum voted for Scum */
int attacks; /* Number of times Town voted for Scum */
int i;
int score[n_players];
int total_scenarios = 0;
for(i=0;i<n_players;i++) score* = 0; /* Initialize everyone's score */
for(players_binary=0; players_binary < 8192; players_binary++) {
players_binary_shifting = players_binary;
for(i=0;i<n_players;i++) {
players* = players_binary_shifting & 1; /* Populate the players[] array according to the value of players_binary */
players_binary_shifting = players_binary_shifting >> 1;
}
n_scum = 0;
buses = 0;
attacks = 0;
for(i=0;i<n_players;i++) {
if(players* == 1) n_scum++; /* Count the number of Scum */
}
/* Count number of buses-- Only counting final votes */
if(players[0] && players[3]) buses++; // Telcontar voted for Fiend
if(players[3] && players[9]) buses++; // Fiend voted for ShadowFacts
if(players[4] && players[5]) buses++; // Meeko voted for BillMC/USCDiver
if(players[4] && players[12]) buses++; // Meeko voted for cardinal_fang
if(players[5] && players[4]) buses++; // USCDiver voted for Meeko
if(players[5] && players[2]) buses++; // USCDiver voted for Chronos
if(players[6] && players[3]) buses++; // pede voted for Fiend
if(players[8] && players[1]) buses++; // Zeriel voted for AllWalker
if(players[9] && players[7]) buses++; // ShadowFacts voted for Scuba_Ben
if(players[10] && players[6]) buses++; // Jimmy Chitwood voted for pede
if(players[10] && players[2]) buses++; // Jimmy Chitwood voted for Chronos
if(players[12] && players[3]) buses++; // cardinal_fang voted for Fiend
if(players[12] && players[2]) buses++; // cardinal_fang voted for Chronos
/* Count number of attacks-- End of day */
if(!players[0] && players[3]) attacks++; // Telcontar voted for Fiend
if(!players[3] && players[9]) attacks++; // Fiend voted for ShadowFacts
if(!players[4] && players[5]) attacks++; // Meeko voted for BillMC/USCDiver
if(!players[4] && players[12]) attacks++; // Meeko voted for cardinal_fang
if(!players[5] && players[4]) attacks++; // USCDiver voted for Meeko
if(!players[5] && players[2]) attacks++; // USCDiver voted for Chronos
if(!players[6] && players[3]) attacks++; // pede voted for Fiend
if(!players[8] && players[1]) attacks++; // Zeriel voted for AllWalker
if(!players[9] && players[7]) attacks++; // ShadowFacts voted for Scuba_Ben
if(!players[10] && players[6]) attacks++; // Jimmy Chitwood voted for pede
if(!players[10] && players[2]) attacks++; // Jimmy Chitwood voted for Chronos
if(!players[12] && players[3]) attacks++; // cardinal_fang voted for Fiend
if(!players[12] && players[2]) attacks++; // cardinal_fang voted for Chronos
if(players[3]) attacks += 2; // Tom Scud and Nanook (known Town) voted Fiend
if(players[11]) attacks++; // Ichini (known Town) voted storyteller
if(players[2]) attacks++; // Oredigger (known Town) voted Chronos
/* Count number of buses-- Withdrawn votes */
/* if(players[0] && players[6]) buses++; // Telcontar voted for pede
if(players[1] && players[4]) buses++; // AllWalker voted for Meeko
if(players[2] && players[3]) buses++; // Chronos voted for Fiend
if(players[4] && players[6]) buses++; // Meeko voted for pede
if(players[4] && players[10]) buses++; // Meeko voted for Jimmy
if(players[4] && players[3]) buses++; // Meeko voted for Fiend
if(players[5] && players[1]) buses++; // USCDiver voted for AllWalker
if(players[6] && players[2]) buses++; // pede voted for Chronos
if(players[6] && players[4]) buses++; // pede voted for Meeko
if(players[7] && players[9]) buses++; // Scuba voted for Shadowfacts
if(players[7] && players[8]) buses++; // Scuba voted for Zeriel
if(players[9] && players[0]) buses++; // Shadow voted for Telcontar
if(players[10] && players[3]) buses++; // Jimmy voted for Fiend
if(players[11] && players[2]) buses++; // storyteller voted for Chronos
if(players[12] && players[6]) buses++; // cardinal_fang voted for pede
*/
/* Count number of attacks-- Withdrawn votes */
/* if(!players[0] && players[6]) attacks++; // Telcontar voted for pede
if(!players[1] && players[4]) attacks++; // AllWalker voted for Meeko
if(!players[2] && players[3]) attacks++; // Chronos voted for Fiend
if(!players[4] && players[6]) attacks++; // Meeko voted for pede
if(!players[4] && players[10]) attacks++; // Meeko voted for Jimmy
if(!players[4] && players[3]) attacks++; // Meeko voted for Fiend
if(!players[5] && players[1]) attacks++; // USCDiver voted for AllWalker
if(!players[6] && players[2]) attacks++; // pede voted for Chronos
if(!players[6] && players[4]) attacks++; // pede voted for Meeko
if(!players[7] && players[9]) attacks++; // Scuba voted for Shadowfacts
if(!players[7] && players[8]) attacks++; // Scuba voted for Zeriel
if(!players[9] && players[0]) attacks++; // Shadow voted for Telcontar
if(!players[10] && players[3]) attacks++; // Jimmy voted for Fiend
if(!players[11] && players[2]) attacks++; // storyteller voted for Chronos
if(!players[12] && players[6]) attacks++; // cardinal_fang voted for pede
if(players[4]) attacks += 2; // Tom Scud and Oredigger (known Town) voted Meeko
*/
/* Count number of un-buses-- Voting to save a fellow Scum */
if(players[0] && players[2]) buses--; // Telcontar saved Chronos
if(players[1] && players[3]) buses--; // AllWalker saved Fiend
if(players[1] && players[2]) buses--; // AllWalker saved Chronos
if(players[2] && players[3]) buses--; // Chronos saved Fiend
if(players[6] && players[2]) buses--; // pede saved Chronos
if(players[7] && players[2]) buses--; // Scuba_Ben saved Chronos
if(players[8] && players[3]) buses--; // Zeriel saved Fiend
if(players[9] && players[3]) buses--; // ShadowFacts saved Fiend
if(players[11] && players[3]) buses--; // storyteller saved Fiend
if(players[11] && players[2]) buses--; // storyteller saved Chronos
if((min_scum<=n_scum) && (n_scum<=max_scum)) /* Throw out cases with wrong number of Scum */
if(attacks*scum_votes > buses*town_votes) /* Throw out cases with Scum not voting Scummily */
/* Add other assumptions (delete or add any considered appropriate) */
if(players[2] == 0) /* Assume Chronos Town */
if(players[4] == 0) /* Assume Meeko Town */
{
total_scenarios++;
/* Output all scenarios */
for(i=0;i<n_players;i++) {
if(players* == 0) printf("%s",names*);
if(players* == 1) {
printf("%s",names*);
score*++;
}
}
printf("
");
}
}
/* Output scores */
fprintf(stderr,"Total number of possibilities: %d
",total_scenarios);
for(i=0;i<n_players;i++) fprintf(stderr,"%s %d
",names*,score*);
return(0);
}[/noparse]
And the results:
[spoiler]
Using only day-end votes, and without assuming I’m Town:
Total number of possibilities: 398
Telcontar 134
AllWalker 129
Chronos 156
Imaginary Fiend 148
Meeko 0
USCDiver 139
pedescribe 116
Scuba Ben 129
Zeriel 122
ShadowFacts 125
Jimmy Chitwood 112
storyteller 148
cardinal_fang 134
Using only day-end votes, and with the assumption that I’m Town:
Total number of possibilities: 242
Telcontar 89
AllWalker 84
Chronos 0
Imaginary Fiend 103
Meeko 0
USCDiver 100
pedescribe 73
Scuba Ben 84
Zeriel 80
ShadowFacts 83
Jimmy Chitwood 74
storyteller 103
cardinal_fang 95
Using all votes, without the assumption that I’m Town:
Total number of possibilities: 433
Telcontar 138
AllWalker 147
Chronos 163
Imaginary Fiend 160
Meeko 0
USCDiver 148
pedescribe 138
Scuba Ben 128
Zeriel 141
ShadowFacts 133
Jimmy Chitwood 141
storyteller 154
cardinal_fang 141
Using all votes, and with the assumption that I’m Town:
Total number of possibilities: 270
Telcontar 93
AllWalker 102
Chronos 0
Imaginary Fiend 115
Meeko 0
USCDiver 104
pedescribe 94
Scuba Ben 83
Zeriel 96
ShadowFacts 88
Jimmy Chitwood 98
storyteller 109
cardinal_fang 98
[/spoiler]The biggest thing I notice about these results is that, under them, there is very little variation in scores. I still show up as the most suspicious, followed by Imaginary Fiend and storyteller, but the results no longer identify any single player as being more than 50% likely to be Scum. This may change as more data come in (I’ll update it after Dusk toNight), but in the mean time, I’m backing away from making any decisions based on this program. And since this program encapsulates my analysis of the votes, I’m also backing away from suspicion based on the voting patterns so far.