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 ...
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 ...
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 ...
30
votes
A first "Hangman" game in Python
You define a clear_screen function, but then at the top you have
...
28
votes
Writing a clean implementation of rock–paper–scissors game in C++
Programming is the art of detecting and removing duplication.
...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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.
...
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 ...
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 ...
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 ...
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 ...
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 :
...
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 ...
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 ...
13
votes
Accepted
13
votes
Accepted
Pseudo Game of Cups in Python
Your code can be simplified using a simple loop, eliminating most of the duplicated code:
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
game × 1976python × 506
beginner × 430
java × 423
c++ × 305
javascript × 232
object-oriented × 212
c# × 197
python-3.x × 186
tic-tac-toe × 144
performance × 129
console × 106
playing-cards × 95
c × 76
rock-paper-scissors × 74
hangman × 64
random × 52
swing × 51
algorithm × 48
c++11 × 48
pygame × 47
dice × 47
snake-game × 45
objective-c × 43
community-challenge × 43