Skip to main content
30 votes

A first "Hangman" game in Python

You define a clear_screen function, but then at the top you have ...
Carcigenicate's user avatar
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 ...
omgimanerd's user avatar
  • 1,135
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 ...
Gloweye's user avatar
  • 1,746
15 votes
Accepted

C++ Hangman Game

Prefer '\n' to std::endl The only difference is that std::endl will flush the stream after ...
Loki Astari's user avatar
  • 95.8k
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 ...
Raimund Krämer's user avatar
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 : ...
Nomis's user avatar
  • 354
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 ...
pacmaninbw's user avatar
  • 24k
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 ...
N3buchadnezzar's user avatar
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, ...
user555045's user avatar
  • 10.3k
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 ...
200_success's user avatar
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 ...
Reinderien's user avatar
  • 63.1k
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 ...
Pavlo Slavynskyy's user avatar
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 ...
200_success's user avatar
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 ...
AJNeufeld's user avatar
  • 33.9k
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 ...
πάντα ῥεῖ's user avatar
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, ...
Roland Illig's user avatar
  • 21.3k
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, ...
ferada's user avatar
  • 11.1k
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()'...
Sank Finatra's user avatar
7 votes
Accepted

Hangman game, written after taking a Python course

Your code structure is one of infinite recursion. Main() calls placeholder(), which calls ...
AJNeufeld's user avatar
  • 33.9k
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 ...
pacmaninbw's user avatar
  • 24k
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, ...
cole's user avatar
  • 616
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 ...
alexanderbird's user avatar
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 ...
FMc's user avatar
  • 12.8k
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 ...
pacmaninbw's user avatar
  • 24k
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 / ...
Grajdeanu Alex's user avatar
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 ...
zondo's user avatar
  • 3,822
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 ...
SylvainD's user avatar
  • 29.2k
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: ...
Phrancis's user avatar
  • 20.4k
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 ...
Ludisposed's user avatar
  • 11.6k

Only top scored, non community-wiki answers of a minimum length are eligible