- 1,235
- Posts
- 11
- Years
- Seen Jun 17, 2017
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