Quote:
Originally Posted by gaming_mouse
Well, it's not a Deck object, it's a Range object.
Yes, I should have called it that. I haven't written any code specifically for this, just have a file on my desktop with brainstorming notes I started a few days ago (although this has been a project idea of mine for a long time).
Quote:
Originally Posted by gaming_mouse
So the meaning of a "having" the PreflopHand 98s changes depending on whether you are PF or flop, and what the particular flop is. PF there are 4 combos, but there will be fewer on some flops, etc.
This is made much more managable with angular's 2 way bindings. I can make a flop directive which will directly manipulate the top level range object, so card removal effects will be accounted for before being parsed into a range string.
Quote:
Originally Posted by gaming_mouse
A Range is made up of PreflopHand objects, and the strings you are referring to are "views" of that Range, ie, just a string representation of the object (the model). You then you need to have the concept of two PreflopHands being continguous, since that is required for doing stuff like JJ+ or 22-55, etc. The string representation itself probably should use Rule objects encapsulating how different sets of cards may be combined into discrete subsets which make up the shortcuts like 22-55, etc.
What do you mean by rule objects? I've figured out a goofy/bad way to parse the full range object into a pokerstove type range string, but I can tell that there is probably some elegant solution out there. Basically it's just iterating through the range object in a predefined order (AA-A2, KK-K2, etc) checking if all combos are set, in which case it gets pushed to a staging array. When it hits a card that isn't all set, it parses the first and last elements of the staging array and makes a string. ie [KT, K9, K8, K7] then if K6 isn't set or only has some combos, the string KT-7 is added to the main range string. When the 'all' condition fails it also checks for all suited combos and will push the suited card tag to a second staging array which works similar. Pairs are the easiest to fold up.
Pokerstove expired apparently (wtf) So I can't check, but I'm pretty sure this would produce the same type of range string. There are weaknesses to it like if you select all the same cards in a row they don't fold up. ie A2, K2, Q2, J2, T2. I saw syntax on I think pro poker tools for something like {x}2 but I'll put off that because it adds more complexity for little gain in terms of the big picture imo.
Angular has the idea of formatters and parsers, so this functionality would actually be a formatter for the range model even though I've been calling it a parser. The parser would be easier imo although I haven't worked on it. With 2way bindings also you could type in AK-2 and the column of buttons should compress automatically. We'll see how it goes though I haven't written a line of code other than playing around to see if I could get the bindings coordinated between components.
The long term goal is to send the range string to a server to play with