Cody challenges added: Poker Series
The math behind this will give you a chance to practice lots of indexing, comparisons, pattern matching, flow control, cell arrays, structures, sub-functions, etc. The test suites have been designed to catch as many edge cases as possible so that to successfully finish each function, you will need to really get it right. You then will get a chance to reuse the code from each challenge to the next.
You will also be able to see how other people solve these problems. For instance, I have put my solution in there to be viewed. My code is usually very long, but easy to understand. You will also see other people using more advanced techniques that use less lines of code. This gives you a chance to see code of known functionality that uses (possibly) unfamiliar techniques.
I recommend you start with the code IsStraightFlush.
Can you make code that can tell that this matrix:
contains five cards in the same row and adjacent columns, while
[0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 1 1 1 1 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0];
does not?
What about the tricky case where the Ace (column 1) is considered high?
[0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 1 1 1 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 1 0];
[0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0;
1 0 0 0 0 0 0 0 0 1 1 1 1;
0 0 0 0 0 0 0 0 0 0 0 0 0];
Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.