Kresimir wrote:Cool. Now I can spot fake wills easier.
I'll continue writing my own, since it's much easier than doing all those steps required for your generator.
Anyways, to fix the problem above, just store names in an array as you write them each night, then you check if that name's been said before. There're also roleblockers and transporters which can make the same person have different results.
That's exactly what I was trying to do, except I was using an arraylist. I encountered two problems that I couldn't figure out after 5 hours:
1. For some reason, the program simply wasn't accurate in searching through the Arraylist and I don't know why. Here's an example of some code I used:
- Code: Select all
for(String alive: playersAliveArrayList)
{
if(!playersUsed.contains(alive)
{
return false;
}
}
return true;
I don't know what the fucking problem was, but I fucked around with it for like 5 hours and it never really worked perfectly. It worked MOST of the time, but it would fuck up occasionally.
2. Once all of the people alive have already been investigated, I want the program to choose a random player and keep their results consistent, which I struggled trying to figure out a decent way of making that happen. As I type this, I realize that I *could* use an ArrayList<String[]> where the string arrays would be of length 2 and contain the player and their result. If I have more time, I might just try doing that.Thanks for your help, though! If you're willing to help further, I could send you the BlueJ package/the Investigator class and you could mess around with it.
Also, just so you're aware, I write all of my wills, real or fake, in that exact format. So don't rely on the format to determine if a will is fake or not, rely on the content.
Also it takes less than 15 seconds to enter in the 14 names (for me at least, I'm a fast typer). Adding legitimate information is simple because it's mostly comboboxes. I don't know how many fake wills you make by hand, but using the space provided in game allows only 2-3 fake last wills MAX. And when your wills become useless because the roles you chose are literally impossible to have present in the game, you're fucked. I, on the other hand, will at least have some kind of backup.
To each their own.
EDIT: Okay so I've managed to make all results consistent (so ignore issue #2), but for some reason my "isFull" method just isn't working. I'm going to re-paste it here so anyone can help.
- Code: Select all
public boolean isFull(Players p)
{
for(String alive: p.getAlive())
{
if(!used.contains(alive))
return false;
}
return true;
}