Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Flask Basics Character Builder Outro

Paul Bentham
Paul Bentham
24,090 Points

Made a basic Hangman game with Flask & deployed on Heroku - feedback welcome.

Hi Kenneth Love,

I've managed to get a basic hangman game up and running with Flask & Heroku (took me about 3 hours to figure out how to get the app deployed on there!).

I'd love some feedback on the Python code as I'm confident it could have been written differently.

Once thing I struggled with was creating a variable in a route and submitting a form which would take me back to the same page but with a value in that variable. It kept resetting the variable back to what I originally set it as.

I know in PHP I can use if isset(), I checked for this in python and found if in locals() but this didnt seem to work on Flask?

Anyway the app is here: https://intense-taiga-2243.herokuapp.com/ and my code is here: https://github.com/PJBentham/Hangman

Thanks,

Paul

4 Answers

Hey! Nice work, although I did encounter some bugs :( First the game does not finish after you guess all the characters, secondly you should not make the input a password, as it's not necessary, and many people using lastpass or similar will be bugged when it asks if they want to store the password every time the they play the game. Lastly you should make it case insensitive :)

Other than that great work!

Very awesome for 3 hours. I find it cool how you made the noose stand with the single texture image. Played the game twice. Only thing that would be a nice addition to the game would be something like an alert statement when player 2 wins are loses. Other than that, very good job

Peter Javorkai
Peter Javorkai
31,477 Points

Thank you Paul anyways, I've already spent like 2 hours with it, so maybe another one will solve the case. :) Have a nice day!

Peter Javorkai
Peter Javorkai
31,477 Points

Hi Paul Bentham!

Really cool game in such a short time! :) I tried to push our bear maker flask app to Heroku, and seriously I've tried everything managing the requirements.txt, runtime.txt but still not getting through the Heroku push. Can you share your secret methodology?

Paul Bentham
Paul Bentham
24,090 Points

Hi, I wish I could remember for you but that was two years ago and I haven't really played around on Heroku since... I do remember it being hard work though. That three hours was the length of time purely spent getting it on Heroku, the app itself probably took longer. Keep plugging away at it though, I'm sure you'll figure it out. Sorry I couldn't help and good luck :)