Skip to content
Sign upLog in

Not Sure Why This isn't working?

Profile icon
1Dagree

Its not completed but it just keeps repeating same thing and i did not program it to do that can someone help

You are viewing a single comment. View All
Profile icon
noodles37

@Uzalii
I would like to help but can you explain how its meant to work? And also what the variables are. What do you mean it repeats the same thing? You made it do that with the while loop.
Also if you are the mafia, it prints infinitely, is this meant to happen?

Profile icon
1Dagree

@SilentShadowBla
the code isn't fully completed yet but the problem is that if you are the most voted (4) then dead should equal true and the game ends but that doesn't happen even if 4 is the most voted (the variable you) it just asks you who the mafia is again. Instead of saying you died and the mafia wins that is the problem.

Profile icon
noodles37

It is going to keep asking you who the mafia is until dead = true

@Uzalii

I am still a bit confused... lol

Profile icon
1Dagree

If you look at the if statment closer to the bottom it says that if you are the most votes then print mafia win and there is the variable dead there which now says dead=True but this if statement is completely ignored even if you (4) are the most voted it still ask you who do you think the mafia is

@SilentShadowBla

Profile icon
noodles37

Tell me if I'm wrong: You only want one input from the user and one from each bot and then it calculates if you have the most votes...? Btw, when it is counting up the votes the number is never over one. lets say that 3 people voted for 3, the value is still 1 vote it would be gr8 if u shared the repl with me...
another thing, you cant vote 4 urself is this supposed to happen

@Uzalii

Profile icon
1Dagree

Yh u are are suppose to be able to vote for itself and 1 person should count as 1 vote so 1 person votes for 3 that counts as 1 vote for three.

@SilentShadowBla

Profile icon
noodles37

are you able to share it with me or are u doing a solo project?

@Uzalii

Profile icon
1Dagree

Right now I am on phone I will send the repl to u when I get on PC

@SilentShadowBla

Profile icon
noodles37
Profile icon
1Dagree