21
votes
Accepted
SudokuSharp Solver with advanced features
This is amazing. Especially for person who is not using C# every day for years.
My main concerns are
too many thing that are public that should be ...
10
votes
Accepted
Rainfall - August 2016 Community Challenge (Hooray for graphs!)
NetworkX is nice, but you really aren't using a lot of its features, and the features you are using end up not being that pivotal; your implementation won't be changed (much) if you remove NetworkX ...
10
votes
Accepted
Complex tokenizer in C#
This looks well structured, with responsibilities nicely separated, but as they say: 'the devil is in the details'. Let's have a look:
CharStream
This class contains some surprising behavior:
...
8
votes
Accepted
You can't sink me
You are correct in your statement that this is a pretty standard OOP implementation. The key signs are lots of mutable state and explicit loops. It's hard to give a line-by-line critique because a ...
8
votes
Complex tokenizer in C#
Looks pretty tidy, a few things:
Consider reversing the check for an empty source in CharStream:
...
8
votes
another Tic-Tac-Toe Game
Game-Loops
You ask
"Maybe also Ideas for the "game loop" (or explanation if you are using it or not)"
Game-Loops are used for animated games (Space Invaders, Pacman, Doom, etc...). ...
7
votes
Rainfall challenge: how big are the basins?
This code snippet appears several times in your code:
...
7
votes
Accepted
Finding the position in a triangle for the given challenge
Your current algorithm is very inefficient. I would use the following algorithmic approach:
...
7
votes
Finding the position in a triangle for the given challenge
| 7
| 4 8
| 2 5 9
| 1 3 6 10
We can see patterns in the columns. We'll take \$x\$ as the input to the function. \$x\$ starts at 1, which will map to the bottom row of the triangle.
The first column, ...
7
votes
another Tic-Tac-Toe Game
You don't really need a game loop in this situation because tic-tac-toe is not an animated game. If you ever wanted to use it, you should use requestAnimationFrame()...
6
votes
You can't sink me
Imperative Programming vs. Functional Programming
AlexFoxGill brought up the point that your code is structured a lot like something you'd write in an imperative language, however, the major ...
6
votes
Accepted
Simple language tokenizer in C#
Much has already been said, but I think I've still got something to add:
Whitespace
Returning a separate token for each whitespace character is probably not very useful. If whitespace isn't ...
6
votes
Rock, Paper, Whatever - A small commandline game
First things first:
1.PEP8
Please run any linter, since your code violates PEP8.
Tripple double quotes should be used in doctrings
Linebreaks(backslashes) are not recommended, preferred way is ...
6
votes
Accepted
Rainfall challenge: how big are the basins?
Tests - Focus and naming
Since you had provided them, the first bit of your code I looked at were your tests. As has been pointed out by @Roman Vottner, their names are not very descriptive. ...
6
votes
Accepted
Rainfall Challenge (August 2016 Community Challenge)
The most obvious changes are to put most of those static methods into the Cell class.
If you thought little bit more carefully you could Tell that ...
6
votes
Accepted
Elevator simulator
There are three types of elevator control systems that I am aware of: rheostat, push-button, and destination-control. Your simulator does not simulate any one of those three types.
I suggest you try ...
5
votes
Recursive and flexible approach to Tic-Tac-Toe
More than four years later... I discovered a bug in the code below:
...
5
votes
Accepted
Parameterized Chutes & Ladders simulator using SQL stored procedure
This is a simple review, but I figure I had to start some where.
there are a few comments that I don't think are necessary to understand the code.
...
5
votes
Accepted
When it rains, it pours - August 2016 Community Challenge
The classes feel empty because you are basically just using fancy dictionaries and a bunch of functions. Don't get me wrong - that's basically all a class is, but if you're going to commit to using ...
5
votes
Accepted
Wandering water ways
I've been looking at this code for a good long while now, and I must admit I don't have much in terms of a review. It's all nicely done!
What few quibbles I have are minor:
...
5
votes
Rock, Paper, Whatever - A small commandline game
i think a win/lose/draw statistics would be really nice. It is quite easy to add:
...
5
votes
Simple language tokenizer in C#
I have some notes in addition to answer of Jesse C. Slicer.
In IsKeyword method the first line is
...
5
votes
Simple language tokenizer in C#
These are just some quick thoughts off the top of my head.
Is there any particular functional reason for TokenType to be ushort?...
4
votes
4
votes
Water flowing swiftly over farmland – The August 2016 Community Challenge
I think this code is great. Using weak references to refer to a Basin is a great way to prevent retain cycles with automatic reference counting. One suggestion I ...
4
votes
'*' present in the print statement-PYTHON
** this means power , for example : 5 ** 2 which mean : 5 squared --> 25. ...
3
votes
When it rains, it pours - August 2016 Community Challenge
Here are some things that may help you improve your code:
Use a better algorithm
Since it hasn't been pointed out yet, the algorithm is faulty. The problem can easily be seen with simple input in ...
3
votes
When it rains, it pours - August 2016 Community Challenge
Minor automatic bookkeeping note: You do
basins[new_basin_coords].size = len(
basins[new_basin_coords].cells)
but since that relationship (A ...
3
votes
Accepted
Rusted Mandelbrot
The code was very easy to read and it seems like you took your time to follow the normal coding style; kudos!
Some small nits:
There's no need for an explicit ...
3
votes
Accepted
Swiftly turning wheels – The May 2017 Community Challenge
Perhaps the fact that this has gone unanswered for quite some time is a testament to the quality of the code. It appears the code is separated well into individual files and indentation is consistent.
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
community-challenge × 128game × 43
java × 32
c# × 25
python × 19
rock-paper-scissors × 16
javascript × 13
calculator × 12
simon-says × 10
beginner × 9
python-3.x × 9
sudoku × 9
c++ × 8
object-oriented × 8
tic-tac-toe × 8
performance × 6
playing-cards × 6
ruby × 5
c++11 × 4
python-2.x × 4
haskell × 4
recursion × 4
css × 4
swing × 4
algorithm × 3