Mafia Player-Role List Generator - a command-line program - 22nd May
I had this blog post pretty much ready to post, but my browser crashed when I opened a link in another tab and now it's all gone :( Anyway here's a shorter version since I don't feel like typing it all again
To practice C++, I wanted to actually make a program. I decided to make a simple little command-line program for Mafia GMs that takes in names of players, names of roles, and then randomly assigns the roles to players, and generates a list to be used by the GM.
But don't worry, you don't have to type in all the names and roles into the program - it reads all that data from .txt files!
You can download the .rar - which includes the executable, as well as the necessary .txt files (which you must edit) - here.
You use the program by:
-In "names.txt", inputting the name of each player, seperated by line.
-In "innocentSpecial.txt", inputting the name of each Innocent Special role, seperated by line.
-In "mafiaSpecial.txt", inputting the name of each Mafia Special role, seperated by line.
-Running the program.
-Specifying the total amount of Mafia players (including Special roles).
-Specifying whether or not there is an unaffiliated player (program currently only supports one unaffiliated faction that can contain only one player).
-The program will then generate the list, and save it to the file "listOutput.txt".
More detailed information on how to use the program is available in the readme included in the package, and I recommend you read it before you use the program :).
The program does work, however I would still consider it a prototype due to the fact that the random generation is done with a PRNG using the current Unix time as a seed, where it would be optimal for the program to source its random numbers from random.org. As such, it is unfit for proper use by a GM, unless that GM is okay with pseudo-random results for their role assignment.
-Cosmic
To practice C++, I wanted to actually make a program. I decided to make a simple little command-line program for Mafia GMs that takes in names of players, names of roles, and then randomly assigns the roles to players, and generates a list to be used by the GM.
But don't worry, you don't have to type in all the names and roles into the program - it reads all that data from .txt files!
You can download the .rar - which includes the executable, as well as the necessary .txt files (which you must edit) - here.
You use the program by:
-In "names.txt", inputting the name of each player, seperated by line.
-In "innocentSpecial.txt", inputting the name of each Innocent Special role, seperated by line.
-In "mafiaSpecial.txt", inputting the name of each Mafia Special role, seperated by line.
-Running the program.
-Specifying the total amount of Mafia players (including Special roles).
-Specifying whether or not there is an unaffiliated player (program currently only supports one unaffiliated faction that can contain only one player).
-The program will then generate the list, and save it to the file "listOutput.txt".
More detailed information on how to use the program is available in the readme included in the package, and I recommend you read it before you use the program :).
The program does work, however I would still consider it a prototype due to the fact that the random generation is done with a PRNG using the current Unix time as a seed, where it would be optimal for the program to source its random numbers from random.org. As such, it is unfit for proper use by a GM, unless that GM is okay with pseudo-random results for their role assignment.
-Cosmic
Total Comments 9
Comments
-
Posted May 21st, 2015 at 8:24 PM by Klippy -
Posted May 21st, 2015 at 8:28 PM by GreenFlame -
Posted May 21st, 2015 at 11:05 PM by gimmepie -
A finished version maybe should properly implement the random.org API, so you get true randomness!
Posted May 22nd, 2015 at 1:56 AM by Melody -
Posted May 22nd, 2015 at 3:04 AM by Salzorrah -
Quote:Quote:
:DPosted May 22nd, 2015 at 8:59 AM by GreenFlame -
Posted May 22nd, 2015 at 11:29 AM by Lycanthropy -
Posted May 22nd, 2015 at 1:13 PM by GreenFlame -
I have been looking for a platform online where they have these services. I wanted someone like my [URL="https://www.topreviewstars.com/dissertation-writing-service/"]https://www.topreviewstars.com/dissertation-writing-service/[/URL] to assist me and I really thank people who helped me out in here by recommending such platforms. Really be grateful to you guys!
Posted November 10th, 2021 at 7:18 AM by BentleyJamal