Skip to main content
52 votes

A simple mastermind clone

This is sophisticated for a first attempt, but today would be a great day to break yourself of bad habits. Your code is full of them. Start with: format your code using standard formatting ...
Eric Lippert's user avatar
  • 14.9k
35 votes
Accepted

Wordle Game clone

I appreciate you came here as a beginner and you're asking on how to improve. Not every developer wants to get feedback. I want to know if the way I programmed this game is efficient IMHO there is ...
Thomas Weller's user avatar
34 votes
Accepted

Rock, Paper, Scissors in C++

It's a good start! Here are some things that may help you improve your program. Don't abuse using namespace std Putting ...
Edward's user avatar
  • 66.5k
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
28 votes

Writing a clean implementation of rock–paper–scissors game in C++

Programming is the art of detecting and removing duplication. ...
Quuxplusone's user avatar
  • 19.4k
24 votes
Accepted

4x4 tic tac toe

Your code is quite good for someone who started 10 days ago. Here are a couple of improvements you should consider: Your code is hard to read due to inadequate indentation and spacing. Take a look at ...
hb20007's user avatar
  • 372
24 votes

Dungeon Crawl game for the terminal

Overall, this is really well done. You've missed the usual traps of using magic numbers, not creating structures for related items, and other common things. So nice work! I think it could be improved ...
user1118321's user avatar
  • 11.7k
24 votes
Accepted

2048 with GUI in C

Well done. This is not a complete review, but instead a (short) list of possible improvements I found when I skimmed your code. Documentation First of all: thank you! It's great to have ...
Zeta's user avatar
  • 19.3k
22 votes

Simple Python turn based battle game

f-strings Beginning with Python 3.6, there is a friendlier way of formatting strings. Instead of using "format string" % (tuple_of_args) where the argument and the ...
AJNeufeld's user avatar
  • 33.9k
21 votes
Accepted

Pong game using SDL

Implementation Is it necessary to put the whole game execution into the Game constructor? (This will cause problems if you ever decide to inherit from ...
hoffmale's user avatar
  • 6,508
20 votes

Scrabble helper: find the highest score with any 7 letters

Your algorithm appears to be "generate all possible permutations of the tiles and check to see which are legal scrabble words". That's a very inefficient way to solve the problem. A better way is to ...
Eric Lippert's user avatar
  • 14.9k
19 votes

A Simple Battleship Game

Magic Numbers Your biggest issue is too many magic numbers and hard-coded information. If you added at the top of your script: ROWS = 5 COLUMNS = 5 then you ...
AJNeufeld's user avatar
  • 33.9k
19 votes
Accepted

A tic-tac-toe game in C

Unfortunately, it seems like you have stumbled across an older version of The C Programming Language which described a dialect of C now dubbed K&R C. K&R C was superseded by ANSI C (C89), and ...
Rish's user avatar
  • 2,391
18 votes

Dungeon Crawl game for the terminal

That's an awesome little game! User experience Before we dive into the code, let's talk about the game itself. Random hangs Sometimes, the executable hangs when I ...
Indiana Kernick's user avatar
17 votes

A GameGrid class to hold the underlying data for grid-based game

For instance, a Console based game might use a char type for the cell value. Whereas, a form based game might use a Label. You seem to be mixing gameplay grids with layout grids. I strongly ...
Flater's user avatar
  • 5,542
17 votes

A dice game called "Greed"

Style You're not being charged by the character; there's no need to abbreviate "count", or "ret" (which I would call "score" instead). Also, main has inconsistent brackets with the rest of the ...
Errorsatz's user avatar
  • 1,354
17 votes

Chess game in C

Use enums to give names to numbers It would be great if you could write PAWN instead of 1, ...
G. Sliepen's user avatar
17 votes

Can I lessen the use of boolean flag variables in this snippet?

Can I lessen the use of boolean flag variables in this snippet? Consider 1st comparing. ...
chux - Reinstate Monica's user avatar
16 votes
Accepted

2D Collision Detection

Collision detection You can calculate the collision much easier with the Rectangle structure. Use the Contains method if you ...
t3chb0t's user avatar
  • 44.3k
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.7k
15 votes

A binary 3D model format for a game

(This didn't fit in the comment field, not really an answer, more like advice) I get the allure of rolling your own format and writing the code, you wanna do it right, you wanna squeeze every last ...
Emily L.'s user avatar
  • 16.6k
14 votes

2 player dice game with login system

FUNCTIONS! Divide your code into functions to make it more readable. In a couple of places, your code is 12 levels of indentation deep! That's the equivalent of 48 characters! Spacing Operators ...
Solomon Ucko's user avatar
  • 1,566
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
14 votes

OOP implementation of Rock Paper Scissors game logic in Java

I don't see anything object-oriented in it. A program without a single non-static method can hardly be called OO. The main task of this piece of code is to compare ...
Ralf Kleberhoff's user avatar
14 votes
Accepted

Text-based role-playing game

I assume this your first project of such size, and if so, that's a great work. It's really cool you've done all this. Bad Recursion This is the worst problem in your code. You see, calling the ...
Pavlo Slavynskyy's user avatar
13 votes
Accepted

Scrabble helper: find the highest score with any 7 letters

Know your data structures. ...
Peter Taylor's user avatar
  • 24.1k
13 votes
Accepted

Pseudo Game of Cups in Python

Your code can be simplified using a simple loop, eliminating most of the duplicated code: ...
AJNeufeld's user avatar
  • 33.9k
13 votes

League of Legends Summoner Analysis

find_game_ids is far more complicated than it needs to be. You have essentially two "counters", Idgame and ...
Carcigenicate's user avatar

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