Reviewing code is fun! Use this tag to identify your post as an entry to the current community challenge. See the Community Bulletin, or browse the CR Meta site for more info. Typically you should also tag community-challenge questions with [tag:game] as well.
13
votes
1answer
2k views
Sudoku Week-End Challenge - Brute-Force Recursive solver
This is part of my attempt at the Week-End Challenge #3. The overall problem is larger than will fit in one question. This is a well-contained subset of my larger program.
The goal of this part is to ...
19
votes
1answer
232 views
A Groovy Election
Implementing the July 2015 Community Challenge seemed relevant considering it is election time.
I decided to go with the strategy pattern as this can be implemented in many different ways. I did my ...
16
votes
2answers
638 views
Sudoku solver in C++
Some time ago, this question was posed, asking for help in optimizing a Sudoku solver implemented in C++.
I decided to reimplement the code using C++11, but without guessing. That is, this Sudoku ...
8
votes
2answers
61 views
Racetrack game with reading the track from a file
For this community challenge I made the racetrack game. I'm reading the race data from a text file, which is available here. This is only playable by entering the velocity at the console.
I've got ...
5
votes
2answers
146 views
Rock, Paper, Scissors, Lizard and Spock with OOP
Today I saw an extremely interesting question on the Rock, Paper, Scissors, Lizard and Spock game. I've decided to take my swing at it and I've written the following OOP implementation:
...
2
votes
1answer
36 views
Rock, Paper, Scissors, Lizard and Spock - Relational Paradigm
I found a few question about the game and IMHO it's a relational problem and better addressed by set logic. Thus I created this solution in SQL to get away from ugly JavaScript, elegant java and ...
17
votes
6answers
3k views
Rock, Paper, Scissors, Lizard and Spock
I am currently done with this little Rock, Paper, Scissors, Lizard, Spock game in JavaScript. The game is working fine, but I am not pleased with the code. Is there a way to refactor these ...
12
votes
1answer
120 views
Ultimate Tic Tac Toe A.K.A. Tic Tactics
My attempt at this challenge., incorporating lessons from this question, which turned out into a much bigger project than I anticipated, but it works. I'll definitely be refactoring most of this in ...
11
votes
1answer
70 views
Racetrack plotter
My Racetrack is just that. A Racetrack. You can't race it (yet) because I had trouble with collision detection, but I wanted to share it anyway.
It creates a base polygon by using ...
10
votes
0answers
94 views
Racetrack pathfinding and path following
Racetrack
The August community challenge is to implement a program that plays the Racetrack game. Each player starts with an integer position on a square grid. On each turn, the current player can ...
11
votes
0answers
113 views
Racetrack in Java
Racetrack:
The August community challenge is to implement a program that plays the Racetrack game. Each player starts with an integer position on a square grid. On each turn, the current player can ...
34
votes
2answers
2k views
Simon Says: “Make me a pretty game”
In Memoriam
Ralph H. Baer, co-inventor of the original "Simon" game, died Saturday December 6th 2014, at 92. With his passing, this friendly little challenge inadvertently became a memorial to ...
19
votes
3answers
185 views
Racetrack in… VBA?
So, I took a look at the August Challenge:
The top-voted answer is
Racetrack1:
"In the game of
Racetrack2, cars race
around a track bounded by two concentric closed loops drawn on a
...
3
votes
2answers
89 views
Permutation and combination calculator
I wanted to make something for the Community Challenge, so I made a simple permutation and combination calculator. I'd like input on:
The overall design - any suboptimal choices that could be ...
10
votes
3answers
578 views
Hello There Calculator
The open source project I work on uses Antlr4 pretty heavily, but I don't know much about it. I thought I would use April's Community Challenge as an opportunity to learn something about grammars, ...
11
votes
2answers
513 views
Simon Says / Four tiles game, with C++ and SDL
My take on the Prebash Challenge, "Simon Says" game, in less than 300 lines of C++ (plus the header file), using SDL for window management and drawing.
simon_says.hpp:
...
13
votes
2answers
149 views
Ultimatoe — 2. The model
The game model (Ultimatoe) consists of 9 instances of Tic-Tac-Toe (UltimatoeBoard) and some auxiliary information. As the number ...
11
votes
1answer
158 views
Ultimatoe — 1. GUI and general game interfaces
For the community challenge, I wrote ultimatoe. For me, the most interesting part is clearly the AI, but what I did so far is just a stupid Monte Carlo tree search, which isn't ready for a review yet ...
12
votes
1answer
146 views
A Smarter random bomber for Battleship
In a further exercise of my original Battleship test framework, I have enhanced and refactored the SmartRandom class from an earlier question and have updated ...
11
votes
1answer
137 views
Decrypting a substitution cipher using n-gram frequency analysis
This is a solution for the June 2015 Community Challenge: a program that decrypts a monoalphabetic substitution cipher. It's written in Python 3, but should be portable to Python 2 if you use ...
4
votes
1answer
60 views
Monoalphabetic Substitution Cipher
In light of this months Community Challenge, I've taken a stab at building something related. Keep in mind, this isn't a submission for the challenge, just a utility to help in the later process of ...
15
votes
2answers
255 views
Newborn pythonic calculator
Let me start off by saying that I have several years of experience in Java, but now I need to learn Python, so I decided to make a calculator as it also is a community challenge.
Please review the ...
14
votes
2answers
153 views
Battleship Challenge: Naval Build-up
The community challenge for this month says:
Everyone has played Battleship. Let's implement the logic that sinks one.
But that presumes that there's something to sink. We can't have the armada ...
10
votes
3answers
970 views
Poker Hand Evaluation - Finding a straight
Weekend Challenge #2 - Poker Hand Evaluation
Finding a straight with wildcards
Because of a size limit on Code Review I have to split my weekly challenge result in two, and here is a part where I ...
7
votes
1answer
106 views
SmartRandom bombing strategy for Battleship game
Now that I have some infrastructure in place to test it (see my Battleship test framework and the updated GitHub project for the full context), I have finally written a non-trivial bombing strategy ...
7
votes
2answers
286 views
A (late) Simple Calculator
As I was looking through my past questions, I noticed my really old calculator question (here and here). Considering it looked like a huge mess, I decided to rewrite it. Coincidentally, the April 2015 ...
13
votes
1answer
177 views
Battleship strategy evaluation framework
In preparation for the May 2015 Community Challenge, I decided to build a Battleship strategy tester.
Implementing an ocean
First, there is an underlying Ocean ...
7
votes
1answer
96 views
Calculator implementation
With some background and experience in PHP & Python, I'm trying to learn Swift by myself (web, videos, Ray Wenderlich books). I've read that a good first project for beginners is to try and write ...
11
votes
5answers
1k views
Simple Java calculator using Swing
This is a Java calculator I made for my programming class. I know there must be vast room for improvement.
Please bear in mind the fact that this only accepts an integer, then an operator, then ...
7
votes
3answers
237 views
First 4-function Swing calculator
This is for a high school class I'm taking. Any tips/improvements?
...
15
votes
2answers
272 views
Calculator Snippet CC
The April 2015 Community Challenge requires building a calculator.
Implement a simple calculator
Where the definition of "simple" is whatever you make it - only
supports basic arithmetic ...
11
votes
3answers
677 views
CC C# calculator
This is my basic C# calculator; I'm sure there is much that can be improved. This design is based on Bjarne Stroustrup's C++ calculator, a purposely be-bugged version of which can be found at his ...
10
votes
2answers
193 views
Yet Another Java GUI Calculator
In the spirit of April 2015 Community Challenge, I have created two Java-based calculators with the following codebase layout:
An interface Calculeightor for ...
12
votes
1answer
155 views
Yet Another Java CLI Calculator
In the spirit of April 2015 Community Challenge, I have created two Java-based calculators with the following codebase layout:
An interface Calculeightor for ...
10
votes
2answers
912 views
Binary Calculator in Java
I'm a beginner in Java and I tried to create a program that will perform basic arithmetic operations on binary numbers.
BinaryOperations class:
...
5
votes
2answers
156 views
Basic arithmetic calculator
The calculator supports the basic operators (Add,Substract,Divide,Multiply).
At the moment,
It only works with positive integers
I do not validate my user input
My division rounds up if it isn't ...
13
votes
1answer
1k views
Ruby Sudoku solver
This week's weekend challenge #3 seemed like a great opportunity to learn Ruby! Unfortunately, my workload and looming vacation did not cooperate. :( The puzzle will make forced moves automatically, ...
10
votes
2answers
133 views
Simon-says in AS3 - Prototyping functionality
My non-serious entry for Simon Says.
Based on literal interpretation of the rules:
Create a UI with four colored buttons that light up in a random pattern. After displaying the pattern, the ...
12
votes
2answers
236 views
Simon says HTML5
Here's a little game written in HTML5 using bleeding edge audio. Since I don't do much HTML5 or Javascript, I'm particularly interested in:
Structure Is this a reasonable way to structure the ...
17
votes
3answers
2k views
I'm Simon, and this is what I say
Play my game!
Having the name that I do (Simon), of course I have to participate in this challenge! (Even though I am a bit "late", but Simon says "have forgiveness!")
This is an implementation of ...
17
votes
1answer
277 views
Simon Says: “Make me a circular window”
This is my first time messing with non-rectangular windows and animations in WPF, so while I'm working on all the bugs I'm having with the actual game code, I'm submitting the XAML for review - I ...
6
votes
1answer
72 views
Simon Says in Scheme
Ok, it's not completely like Simon Says, since it's text-based. There is nothing about memorizing based on visual cues and/or sound here, just memorizing long sequences of numbers. I wanted to do it ...
8
votes
2answers
93 views
Simon's Opposites Game
I cooked up this little game today for the community challenge mentioned here. The idea of the game is that sometimes when Simon gives you a color, you should choose the opposite color (the color in ...
12
votes
1answer
424 views
Simon Says in Javascript (with Knockout) - Playable Code Snippet
I resolved to do the whole thing with just vanilla Javascript as a challenge, but man, Knockout's binding and state management is just too easy.
A tiny bit of callback hell to get all the flashing / ...
10
votes
1answer
414 views
Simon game / Four tiles game
When I read the community challange, I couldn't wait. So here I go with the very first Four tiles game:
...
13
votes
3answers
2k views
RPSLS Game in C#
I went with what I know and can use well, not what I know and can't figure the syntax out to make it look good.
So please enjoy the code and prepare to school me (probably in the basics) in C#
...
10
votes
2answers
151 views
RPSLS yet again
I guess I'm a little late with my entry to this code challenge mentioned here, but I decided the world must need yet another RPSLS implementation to critique.
...
8
votes
3answers
128 views
RPSLS refactored to Object Oriented
I wrote a couple reviews for this CR post. In my most recent review, I refactored @Malachi 's code to fit OO design. I'm looking for any advice/hints/criticisms on it.
A review is welcome for both ...
12
votes
3answers
322 views
RPSLS is less messy now, but is it clean?
This is a follow up to the following questions:
RPSLS Game in C#
Is my coding technique progressing in terms of C# loops?
I haven't made my way to DecideWinner() ...
7
votes
3answers
241 views
RPSLS game revisited. Is my design better than previous attempts?
This question is a follow up to these questions:
RPSLS Game in C#
Is my coding technique progressing in terms of C# loops?
RPSLS is less messy now, but is it clean?
Right now I have a couple of ...