Having said that, we should get going!
Okay, so...there'll definitely be a GUI. Probably several, combined into one, to stick with the OOP nature of Java. That looks icky, so we won't start with that. We could have bots, I suppose, but if we do, that'll be at the very end. It appears we're getting ahead of ourselves, so let's go down to a more basic level. What's needed to play the game, not thinking in terms of programming.
1) Players
2) Table
3) Deck of Cards
4) Cards to put in the deck
5) Dealer, to handle...dealing. Also, shuffling.
6) Hand of cards, for each Player
I think that`s enough to think about for now. Hopefully, you`ll agree that a Card is probably the simplest object here, so let`s work on that today. It`s a simple class, since it`s such a basic object, with only a rank and suit:
Ah, you remember enumerations, right? The guy who's (open source) work I'm jacking didn't, so this is probably a BIG sign that there'll be jumping back and other technical difficulties, but fuckit, I'm here to learn!
There, now we have both enumerations complete, we just put in our constructor. Normally you'd have a couple of if-statements to error check, but eh.
And here's all the methods. Simple things to return the suit and rank, and a basic toString() method. I might have to put a comparison in there later, but I'm not sure, yet! For now though, it looks like we're done with our card class.
Class adjourned! See you tomorrow! Questions/comments welcome, as always.
oh god i love this kind of posts!
ReplyDeleteGood to know! Texas hold em rules!
ReplyDeleteIsn't there a complete version out there that you could refer to? I'm pretty sure that be of more help to you.
ReplyDeleteWoot! Here we go, looking forward to this. Although I'm fuzzy on the actual rules of the game so I might have to re-learn them before I look into the coding process.
ReplyDeleteI like where this is going. (:
ReplyDeleteYay! I'm printing your java walkthrough to start learning hard mode in february :D
ReplyDelete