Friday, 30 December 2011

Java: Texas Hold Em (31)

Okay, today I'll try leaving in the commentary to the code, leaving my posting text to stuff like this, that's not directly code related!

Today we'll be looking at the method that handles showdowns in the game, enjoy!

(This method barely fits into one screenshot, so I'll be doing a smaller method afterwards, too)

Apart from the section where I state I have no idea what the balls is going on, the commentary should be sufficient that I don't need to explain it again here! (Do I? Vote or comment it, then!).
I will, however, do my best to explain what happens while not quite knowing:
The method getWinners appears later in the code. We'll cover that on Monday, but what it does (not important how it does it to understand what's going on. The core concept of abstraction!) is returns the active players mapped and sorted by hand value, sorted in descending order.

I should probably mention that a Map takes 2 parameters within its angle-brackets, as you might have noticed. The Map is an object that maps keys to values. The first parameter covers the type of keys present while the second covers the types of values mapped to these keys! You'll probably see in more detail on Monday when we go over the getWinners method. I'll even go through a  tutorial on Tuesday, since the Table will be done by the end of Monday!

Anyway, here's just a little bit extra so we can finish this class comfortably at the start of next week. This lets a player win the pot!

Self-explanatory, right? Good! If not, leave a question in the comments! Everything you throw at me is welcome! See you on Monday!


  1. Yep, pretty self explanatory. Also, a nice laugh was had at seeing you didn't know what was coming up. :D

  2. I love when I win pot, I mean the pot!

  3. Those comments are good. Aren't you supposed to always have those in? That's what they taught us in class.