Splinterlands Hangman with holoz0r - a development in Python

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@holoz0r·
0.000 HBD
Splinterlands Hangman with holoz0r - a development in Python
A few days ago, I said that I was starting to learn Python. I am doing exactly that. 

![image.png](https://files.peakd.com/file/peakd-hive/holoz0r/EnyoS3bPiYEbCRZVzFvjjzQs4JQQxqvwfRqHnKxsB6M5yQ5J8ZrNSWTU1UYarzSA4ot.png)

I have published this game on <a href="https://github.com/holoz0r/SplinterlandsHangman">GitHub</a>, and while it has many issues, Please remember that I am at day 7 of my journey to learning Python. 

I might come back to this project as I get better, and improve upon it; but for the time being, it is a fun little project built out from the skeleton of the course I am following. 

If you're a crazy experienced developer, please poke holes in my code and tell me why and how it can be improved. I'd love to know! 

```python
import random
from hangmanart import *
from hangmanwords import word_list

end_of_game = False
chosen_word = random.choice(word_list)
word_length = len(chosen_word)
lives = 6
print(logo)
#Testing code
# print(f'Pssst, the solution is {chosen_word}.')

display = []
for _ in range(word_length):
    display += "_"

while not end_of_game:
    guess = input("Guess a letter: ").lower()

    for position in range(word_length):
        letter = chosen_word[position]
        if letter == guess:
            display[position] = letter 

    if guess not in chosen_word and lives >0:
      lives -= 1
      print(f"You have {lives} lives left.")
      if lives == 0:
        end_of_game = True
        print("You Lose!")
        print(f"The Correct answer was {chosen_word}.")
    print(f"{' '.join(display)}")

    if "_" not in display:
      end_of_game = True
      print("You win.")

    print(stages[lives])
```


![image.png](https://files.peakd.com/file/peakd-hive/holoz0r/Eo1wMUJgRgeUymF3YdpjU4Upydpo8VKHT5tbY8WWevZwUBJufSvYc5pFar5kTC4wJ3C.png)

Until next time... 

<hr>
<center><h4>Want more holoz0r and Splinterlands?</h4></center><br/>

<div class="pull-left">https://files.peakd.com/file/peakd-hive/holoz0r/AK2BjKGGLBFTBPhtsWKMnsmFFJDQrhXbbM35f6dRxoT4fEqqegsPLWdwizYRNxw.png</div><br>If you want to see my Splinterlands antics and rants live, Find me on <a href="https://www.twitch.tv/holoz0r">Twitch</a><br/><br/>

If you prefer sleeping in your designated time zone, <a href="https://www.youtube.com/channel/UCuupHoy5KyWOjRbqIY5F4HA">go watch replays on YouTube</a>.<br/><br>

<a href="https://splinterlands.com?ref=holoz0r">If you haven't started playing Splinterlands, you should do that immediately. It's very good fun.</a><br/>

<a href="https://www.youtube.com/watch?v=hu8eFSUIFTs&list=PLBqiQz1Xjoxv06-zmi2cYURz0AI-jI0x4">Go and watch me open season rewards and packs on YouTube!</a>

<hr>

<center><h4>Want more content from me?</h4></center>

<a href="https://peakd.com/ccc/holoz0r/holoz0rs-a-z-of-steam-a-complete-archive-to-date">Witness my futile efforts to play my Steam Game collection in alphabetical order</a>.

Are you aware that I love photography? <a href="https://peakd.com/ccc/holoz0r/photographic-works-and-ramblings-of-holoz0r">Check out my work in a collection.</a>

<hr>

<center>Thanks as always for your time!</center>
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,