Linked Questions

30 votes
7 answers

Basic OOP Poker - Deck, Cards and Hands

I decided it would be interesting to simulate a game of Poker. Baby steps at the moment, and eventually I'll attempt to turn it into a GUI. The code I have so far is very basic such as populating a ...
dan's user avatar
  • 303
20 votes
3 answers

Recursive and flexible approach to Tic-Tac-Toe

Description This is my code for the Weekend Challenge Reboot - Tic Tac Toe Ultimate. The game can be played here: (along with some other variations that are also use the ...
Simon Forsberg's user avatar
12 votes
3 answers

RPSLS is less messy now, but is it clean?

This is a follow up to the following questions: RPSLS Game in C# Ensuring user input is an integer in a range I haven't made my way to DecideWinner() yet, but ...
Malachi's user avatar
  • 28.6k
17 votes
2 answers

Vector-to-direction method in Java

I don't really have a problem, but my code bothers me, because I know it could be done in a much better way. I have an enum of 4 directions: north west, north east,...
Vapid's user avatar
  • 347
10 votes
3 answers

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 ...
Simon Forsberg's user avatar
7 votes
4 answers

Saving enum value using name()

Let's assume I have an enum type enum ComponentState { TURNED_OFF, TURNED_ON, SUSPENDED, TO_REPAIR; } This enum describes a state of some ...
radekEm's user avatar
  • 934
3 votes
2 answers

Enum vs lookup table for temporary and permanent teeth

I'm implementing a solution in Java using Ebean and I'm having some issues choosing between using enums or simply look up tables. I have a table "Tooth". A tooth ...
KirdApe's user avatar
  • 95
4 votes
4 answers

Poker Game: Unit testing different poker hands without violating DRY principles

I'm currently in the process of refactoring an old poker game which violates many of the SOLID principles. I was trying to use the TDD approach to refactoring and I found myself having to hard code ...
asathkum's user avatar
  • 155
7 votes
1 answer

Custom Serialization of Game World

I'm working with libGDX for a game, and over the last few days I have tried a few different types of serialization before settling on a custom serialization implementation. XML had huge file sizes, ...
bazola's user avatar
  • 8,579
2 votes
1 answer

Finding the best category of poker hand

I have 16 methods in Java that return int values. I need to find the one that returns the highest value. I initially implemented this: ...
Anindya Dutta's user avatar