30
votes
A first "Hangman" game in Python
You define a clear_screen function, but then at the top you have
...
24
votes
Accepted
Beginners Python Hangman Code
Welcome to Python, and welcome to Code Review! Here are some basic tips to help you along.
0.5. EDIT: I think you also have an unused import. import string is not ...
16
votes
Accepted
My first Hangman game in Python
While it's clear that you're new to python, it's still pretty good that you got it to run first time. Good job!
Input Validation
Currently, you have a list of forbidden characters. While that can ...
15
votes
Accepted
C++ Hangman Game
Prefer '\n' to std::endl
The only difference is that std::endl will flush the stream after ...
14
votes
Hangman Game with C++
I will proceed from a high level to a low level perspective.
Starting with main.cpp:
Game pass;
pass.onOffSwitch("close");
The meaning of these two lines are ...
14
votes
A first "Hangman" game in Python
It's not that great of an optimization but if you're new to programming it can be interesting to consider something along the line of :
...
13
votes
Hangman Game with C++
Single Responsibility Principle
The class Game does too much directly, this could be an aggregation of classes instead. One of the points of the Single Responsibility Principle is that a class or ...
11
votes
Accepted
Simple Python hangman game
Overview
I can see that you are a beginner and that is totally fine! Some of the points I will be making might, sound a bit harsh and go over your head. If they do try to improve the parts of the ...
11
votes
Accepted
Hangman Bot built with performance in mind
The SIMD code has type errors.
The problem is currently a bunch of floats are read, assigned to a SIMDi anyway, added as floats (and remember, these were integers, ...
9
votes
Find all words that satisfy unknown letters (Hangman)
The solution would indeed be much simpler using regular expressions. The trick is to build the regular expression dynamically, using a negated character class like ...
9
votes
Hangman Bot built with performance in mind
The only obvious thing I see is that your realloc machinery is too complicated given the task at hand. Your entire word file is only 530 KB. You could easily ...
9
votes
Accepted
Hangman game in Python with nine possible words
This looks pretty good for 1-month coder. Keep it up!
Use functions, classes and tests
If you have already learned them - use them. If you haven't - learn them. Start with functions. They are in the ...
8
votes
Accepted
Hangman implementation for teaching a Python course
I could come up with a laundry list of improvements. However, I would like to focus on just one issue, which makes your code an unforgivably bad example for your students: you are misusing functions ...
8
votes
A first "Hangman" game in Python
Clearing the screen
os.system('cls') is a horrible way of clearing the screen.
The cross-platform ...
8
votes
Hangman Game (YAHG)
1. Use classes to separate concerns
One improvement could be to introduce your own classes to separate the hangman drawing, from the main game loop.
Something like
...
8
votes
Hangman Bot built with performance in mind
There is no need to implement stringEqual yourself. Use strcmp(a, b) == 0 instead.
For all variables that contain memory sizes, ...
8
votes
OOP Hangman Game
From the first looks, quite nice. I have mostly just a few smaller
concerns:
Consistency matters for readers, so should be either x = y, ...
7
votes
Hangman in Python 3
Good work! I applaud you on maintaining readability and having a compartmentalized, functional program. From a glance I suggest this:
Lines 32 and similar input()'...
7
votes
Accepted
Hangman game, written after taking a Python course
Your code structure is one of infinite recursion. Main() calls placeholder(), which calls ...
7
votes
Hangman Game (YAHG)
Welcome to Code Review! On my first scan through the code I was impressed. I learned a new C++ STL library function, std::transform(). I was really glad to see that there was no ...
7
votes
Accepted
Removing OO style coding from Haskell
Prelude
First of all, good work! I can see the effort you put into grokking something so foreign, and I would like to commend you for it. I will be focusing on reviewing what I think you can improve, ...
7
votes
First Hangman Game. Need Honest Opinion
Currently, you have print statements mixed throughout your game logic. I would suggest separating your code into the part that decides what to do with the latest input, and the part that prints a ...
7
votes
First Hangman Game. Need Honest Opinion
If a function just calls another function, delete one of them. You
don't need both main() and testing(), since the former does ...
7
votes
Accepted
Hangman game in C
General Overview
This is pretty good for a beginner.
I see some best practices are already being followed such as placing single statements in an if statement ...
6
votes
Hangman implementation for teaching a Python course
First of all, congrats for teaching Python! I wish there were more crash curses related to it.
Now, about your code:
you have loops (while / ...
6
votes
Simple Python hangman game
Your WORD_LIST doesn't really make sense. It isn't a list, but it should be. Your rand_words are exactly what lists were made ...
6
votes
Beginners Python Hangman Code
Temporary review, I'll try to improve it.
Style
Python has a style guide called PEP 8. It is definitly worth reading and following (except if you have good reasons not to).
You'll find various ...
6
votes
Accepted
Another Python Hangman
Playability
I ran your game to test it out first, and noticed something odd when a letter is found twice in the same word, such as "glass" here:
...
6
votes
Accepted
Simple game of hangman which counts wins and losses
Well done
There are some obvious beginner mistakes, but you have created a working game.
Avoid working in the global namespace
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
hangman × 203python × 96
beginner × 73
game × 64
python-3.x × 49
java × 41
c++ × 23
object-oriented × 20
console × 14
performance × 13
python-2.x × 11
javascript × 9
c × 7
c# × 6
haskell × 5
functional-programming × 4
rust × 4
swing × 4
ascii-art × 4
strings × 3
c++11 × 3
homework × 3
php × 2
programming-challenge × 2
html × 2