Thursday, 5 January 2012

Java: Texas Hold Em (34)

Ah, for those unaware, debugging is the process of finding/identifying errors (bugs) and removing them from some program. Doing this is mostly uninteresting, and in the case of the ConsoleClient, just involves me running the entire class and seeing what it does, then trying to find out why it does that.

I was going to document the debugging, but only after we were done with the class, since errors crop up in the form of methods we've not covered, and it'd get confusing :)

For now, though, lets get to finishing the ConsoleClient. Looking at the Client interface, there's 7 or so more methods to go! Here we go:

These are more simple methods that don't really bear explanation, but they do exist, and you do need to see them, and having too much in a post means nobody gives a flying crap about anything in it, so we won't even be finishing today!

However, just to go over them real quick: Nothing happens when someone joins the table. That's all handled in the constructor. Other than that, everything above just prints out a different message, making use of string formats!

I went over more lines than I needed, above, so it looks like more than it is, but honestly, its super easy. The first method, written without regard to screenshot-width would only be 3 lines. Get the player's cards and when they have 2, print them out.

The last method mentions that a player has taken their turn and just string formats it all in.

Man, I am sorry these are so simple, especially after the tough stuff we've already been over, but having made use of all the other classes we've gone over, there's not much for this class to do!

Tomorrow, we'll do the final method in this class. Really, the only one with any real length to it, and then it'll be done. This means next week, we'll get to debugging the console client (which makes use of all the other classes we've used, directly or otherwise) until it appears to be working fine. After that, we either start on the bots or the GUI. Probably the GUI, fuck programming AI =<

Questions and comments are welcome, so go crazy! See you!

Also, check it, I got a sweet mention in DWei's blog since I'm so good at suggesting things, apparently! Acknowledge me!


  1. Kay, thanks for clearing that up as I totally overestimated the debugging. Also, simple is good.

  2. I did not know what debugging was.

  3. it is quite useful to see variables change as they change. invaluable tool/process

  4. It's good to have simple things though, gives all of us a bit of a break.