Problem 333. Poker Series 02: isQuads
Solution Stats
Problem Comments
-
3 Comments
Just checking, maybe I got this wrong but could you try adding this test?:
hm = [1 0 0 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0 0 0];
y_correct.flag = true;
y_correct.usedCards = logical(...
[1 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 1
1 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])
I believe several of the current solutions would fail that...
sorry, comments remove formatting, I meant:
hm = [1 0 0 0 0 0 0 1 0 0 0 0 0;1 0 0 0 0 0 0 1 0 0 0 0 1;1 0 0 0 0 0 0 1 0 0 0 0 0;1 0 0 0 0 0 0 1 0 0 0 0 0];
y_correct.flag = true;
y_correct.usedCards = logical([1 0 0 0 0 0 0 0 0 0 0 0 0;1 0 0 0 0 0 0 0 0 0 0 0 1;1 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])
Added the test case. Thank you for the addition.
Solution Comments
-
2 Comments
Hi,
Why is test 3 not a quad? Is that a typo?
Tyler, the hand matrix in Test 3 has only four cards. Even though it has four-of-a-kind, there's no kicker, so it's not a valid poker hand.
-
1 Comment
I think something is wrong with the test script.
-
1 Comment
not sure but this does not seem to consider Ace as the highest hand? (as it does for the kicker); the test suite does not discriminate...
Problem Recent Solvers88
Suggested Problems
-
Select every other element of a vector
28201 Solvers
-
1381 Solvers
-
51 Solvers
-
Make a run-length companion vector
615 Solvers
-
Return a list sorted by number of consecutive occurrences
324 Solvers
More from this Author51
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!