Showing posts with label player guess word in python. Show all posts
Showing posts with label player guess word in python. Show all posts

Tuesday, December 5, 2017

How to guess a word in python?

Time again for a game script. How it works This is a classic "guess a word" program.
The word to guess is represented by a row of dashes. If the player guess a letter which exists in the word, the script writes it in all its correct positions.  The player has 5 chances to guess the word. You can easily customize the game by changing the variables.
Code :
C:\Users\SSS2014033\Desktop\cs1.JPG

C:\Users\SSS2014033\Desktop\c2.JPG

C:\Users\SSS2014033\Desktop\c3.JPG

Save this program as “Guess the secret word.py” as shown below:

C:\Users\SSS2014033\Desktop\gs1.png


To start the guessing word, enter the user name.
C:\Users\SSS2014033\Desktop\gs2.png
Now the user can start guessing the word by entering characters, as shown below:
C:\Users\SSS2014033\Desktop\gs3.png


Enjoy it!