Hangman Code.

Denis McMahon denismfmcmahon at gmail.com
Thu Dec 17 09:12:01 EST 2015


On Thu, 17 Dec 2015 05:28:23 -0800, trkaplan24 wrote:

> Hello, I created a python code for a simple hangman game. Was wondering
> if anyone could edit to help me make it multiplayer so when one person
> guesses a letter incorrectly, the next player can then guess a letter.

First you need to prompt for the number of players, and store this in a 
variable.

Next you need a variable to keep track of the current player. Set this to 
1 at the start of the program, because we're humans and we like to be 
player 1 ... player n, not player 0 ... player n-1.

Use the current player variable value to prompt for the next player.

After each player takes a turn, add 1 to the current player. If this is 
greater than the number of players, set it back to 1.

-- 
Denis McMahon, denismfmcmahon at gmail.com



More information about the Python-list mailing list