Tuesday, 13 December 2011

Java: Texas Hold Em (20)

Hey now, the Client isn't empty, only everything that it does is! Wait, does that make it sadder? Who cares, it probably deserves it. That's right folks, it's time to get the Client done, and therefore officially the start of the "What the fuck am I doing, and why?" part of the project! At least we're not at the "What am I doing, and how am I supposed to work out how?" part?

Here we go!

Monday, 12 December 2011

Java: Texas Hold Em (19)

Hey hey, post as promised, late as promised! I'm so awesome! Today we're continuing with our HandValue class, and we'll be done with it tonight! I do hope after all this time wasted this project doesn't end up being a flop :P

After this, we could move on to the Table, but that is what Players sit at, so we should do those. However, it looks like the Player class needs a Client interface to work with. Being an interface, and not a class, if you remember, this means that Client will be a collection of related methods, but empty.

We`re starting to get into territory that I don`t quite get, so...good luck? We'll see how this pans out!

Monday - Late post

So, I've had to stay up until midday before I could sleep, so just a heads up, todays post will be superlate, because fuck writing it up now!

Sunday, 11 December 2011

Java: Texas Hold Em (18) - Weekend Post

Whoops, lost track of time, but here's the second weekend post! We'll keep this one short too, and tomorrow we'll move back to the standard posts. One more week with weekend posts, then back to the 5/week schedule.

Working from the pseudo-blueprint we constructed yesterday, let`s get through the instance variables and the constructor for the HandValue class:

Saturday, 10 December 2011

Java: Texas Hold Em (17) - Weekend Post

Heh, almost forgot about saying I'd do this for 2 weekends :P Since it's the weekend and everyone probably just wants to chill, I'll keep it short and sweet.

We're starting with the HandValue class, and what this does, basically, actually gives some representation to the value got by the evaluator, complete with a toString() method and a way to compare hands! As a general blueprint, we need:

Friday, 9 December 2011

Java: Texas Hold Em (16) - HandEvaluator Finished.

Okay, so, today we finish this class up, finally. That's the good news. The bad news is, there's still a HandValue class to get through, which will put together the HandValueType and the HandEvaluator, so we're not totally out of the woods.

The HandValue class should be finished in 2-3 days though, so it's not so bad. Enough talk of the future, let's get done with the now!

Thursday, 8 December 2011

Java: Texas Hold Em (15)

Busy, busy! Just gonna throw my post out there today, and be done with it :P Today we get through Four of a Kind and Straight Flush, tomorrow, we finish this class (bloody finally) with the Royal Flush and the Constructor that actually uses everything we've made!

Fwoomp (That's the sound of code falling into place):

Wednesday, 7 December 2011

Java: Texas Hold Em (14)

There appears to be some trouble with understanding the coding that's been going on. That's fine, I'm not exactly 100% on everything, either. The thing to remember is you need to know exactly what you're trying to do with some code, and then work out all the steps required for getting there, bit by bit. Computers are dumb, you can't just say "Throw me the ball". You need to take it in small steps. "This is the ball. Picking something up involves... Now pick up the ball. Swing your arm in x direction and release the ball..."


Luckily, a lot of the time, coding involves modifying someone else's code instead of creating stuff from scratch, so you have the option of looking at what steps are being taken, then thinking of how you can do whatever you want from that point onward. Here's today's code:

Tuesday, 6 December 2011

Java: Texas Hold Em (13)

Ahoy there. Today we're going to continue on the same train of thought as yesterday, this time making a boolean method for the next 2 hand value types: Three of a Kind and Straight. Let's dive right into it, since there's no administrative stuff to go through:

Monday, 5 December 2011

Java: Texas Hold Em (12)

Okay, back on track! To make up for the previous week, I'll be doing Sat-Sun updates for the next 2 weeks! We should be done with the evaluator comfortably this week, allowing us to move on, and we'll soon be out of the comfort zone of someone else's code, which I'm kinda worried about, but oh well.

We left off last week at calculating any duplicates, as well as the high card of a hand, so the progression from this point would be to have a bunch of private methods for use in the constructor that actually as "Does this hand contain x?" for each of the possible hand value types. Here we go: