Hot answers tagged

105 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. ...
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. ...
37 votes

How clean is my snow?

You don't get drops of snow! Clearly it should be for flake in flurry:
  • 615
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 ...
  • 64.9k
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 ...
  • 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 ...
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 <...
  • 5,764
27 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, ...
  • 110k
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 ...
  • 11.6k
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,...
  • 96.9k
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: <...
  • 41.8k
21 votes

How clean is my snow?

def createRandomDrops(): dropCount = 4 for i in range(dropCount): Magic number 4 in middle of the code ...
  • 311
21 votes
Accepted

List the movies I haven't seen

Welcome to codereview. Here are my suggestions: Functional decomposition and Naming The trickiest part of programming is to decouple your complex problem into smaller easier (sub)problems. It is ...
  • 6,882
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 ...
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 ...
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...
  • 110k
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 ...
  • 22.2k
17 votes
Accepted

Change desktop background

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

Scoring a Scrabble Word

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

Marijuana information program

...
  • 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 ...
  • 10.9k
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 ...
  • 64.9k
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 ...
16 votes
Accepted

Progress Bar in C++

I wrote a simple main() function to test this: int main() { show_progress_bar(100, "progress", '#'); } I ...
  • 62.9k
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++ <...
  • 11.6k
14 votes

Full C++ Snake game

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

A top-like live monitor for virsh/kvm/qemu VM's

Subprocess out, _ = subprocess.Popen(['virsh', command, arg], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate() is a little clunky; consider ...
  • 54.4k
14 votes
Accepted

Tic-Tac-Toe code using c#

Choosing good identifiers When I see a name like options I think of something a player can choose from like "single player" (i.e., play against the ...
13 votes

Tic Tac Toe in the Console

Some quick remarks: public properties should be PascalCase. use Auto-Implemented Properties. Capitalize the various parts of boxone etc., e.g. ...
  • 10.9k

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