Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Hot answers tagged

104 votes
Accepted

How clean is my snow?

Let's look at the code. from random import randrange import time Your imports are very minimal! Good. ...
user avatar
59 votes

How clean is my snow?

Cool animation! Let's get some linting out of the way. As per PEP 8, you should use 4 spaces of indentation consistently, and function names should be snake_case. ...
user avatar
36 votes

How clean is my snow?

You don't get drops of snow! Clearly it should be for flake in flurry:
user avatar
  • 605
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 ...
user avatar
  • 64.1k
33 votes
Accepted

Loading... animating dots in C

Too frenetic I ran your program but it was very frenetic. It was constantly clearing the "Loading" prompt and reprinting it which resulted in a flickering effect. In addition, the cursor also moved ...
user avatar
  • 28.4k
31 votes
Accepted

"Compliment giver" mini-program

Don't be discouraged by how much I have written. I'm a professional software developer and my colleagues make fun of me because of how pedantic my code reviews are. I think what you've done is ...
user avatar
30 votes

How clean is my snow?

I'm surprised no one has talked about your character choice! Why are their a bunch of hashtags falling? Nah, I kid, it was an ok choice of character, but we can do better! What about changing the <...
user avatar
  • 5,599
26 votes

Simple text-based RPG in Java

OOP This task really begs for object oriented programming. As a first step, I suggest moving the maxhp, playerhp, ...
user avatar
  • 107k
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 ...
user avatar
  • 11.5k
22 votes

"Up" script for moving up directories quickly

This is a decent concept, but by looping on the cd you loose some of the value of the $OLDPWD function in the shell. For example,...
user avatar
  • 96.7k
22 votes
Accepted

pyCMD; a simple shell to run math and Python commands

The first thing I notice with your code is that the code is a very long global script. To resolve this I'd start by moving your code into functions. The actual calculations could be as simple as say: <...
user avatar
  • 41.6k
21 votes
Accepted

Text-based adventure game with too many conditional statements

I have found a couple of things that could help you improve your code. Don't abuse using namespace std Putting ...
user avatar
  • 64.1k
20 votes
Accepted

A completely repetitive console prompt, a completely repetitive console prompt

String Formatting if (!requireValue) Console.Write(string.Format(message + " [{0}]: ", defaultValue)); else Console.Write(message + ": "); This innocent ...
user avatar
20 votes

How clean is my snow?

def createRandomDrops(): dropCount = 4 for i in range(dropCount): Magic number 4 in middle of the code ...
user avatar
  • 301
18 votes

Non-AI Tic-Tac-Toe program

Overall, I think it is a pretty good program. I think I see one bug. You don't check that the user's input for slotChoice is valid. If the input is outside the ...
user avatar
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 ...
user avatar
18 votes

Tic-Tac-Toe for the terminal

First of all: nice work! It's easy to read and understand. Program organization It's very good that you split the task to small functions. Reading the body of main...
user avatar
  • 107k
17 votes
Accepted

Text-based BlackJack game

To other reviewers: I've tackled design and the use of arrays. I didn't touch much on the actual code, although I do hint at things. Recursive Main and Design You can easily remove the recursive ...
user avatar
  • 22.2k
17 votes
Accepted

Change desktop background

These using directives are not needed and can be safely removed: ...
user avatar
17 votes
Accepted

Scoring a Scrabble Word

Whoa! Don't do this: ...
user avatar
  • 28.5k
17 votes

Marijuana information program

...
user avatar
  • 25.2k
17 votes
Accepted

Design patterns for console commands

Why do you have the Command class? Why not make life much simpler for yourself by making AllCommands a ...
user avatar
  • 10.6k
16 votes

Text-based adventure game with too many conditional statements

I guess what your teacher meant is this: if (choice == 1) { spider(); But there is a better way to write this. You adventure game is actually a Finite State ...
user avatar
16 votes

"Who are you, and where do you live?" — a Q&A exercise

I have found a couple of things that could help you improve your code. Don't abuse using namespace std Putting ...
user avatar
  • 64.1k
16 votes
Accepted

"Up" script for moving up directories quickly

Your recommendation is to define alias up=". path/to/up" so that when you type up 3, it expands to ...
user avatar
16 votes
Accepted

Progress Bar in C++

I wrote a simple main() function to test this: int main() { show_progress_bar(100, "progress", '#'); } I ...
user avatar
  • 57.8k
15 votes
Accepted

Minesweeper C++

C++ Vs C As has been said in the comments, your code reads very much like it's been written in C. You're using C functions like printf instead of the more C++ <...
user avatar
  • 11.5k
14 votes

Markup calculator application using MVC

I scanned through your code and also stepped through it with a debugger, line-by-line. The more I looked, the more things I found that I wanted to point out. Let's start by looking at some ...
user avatar
14 votes

Full C++ Snake game

Using constants Rather than using #define and creating a bunch of macros like this: ...
user avatar

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