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 Solvers87
Suggested Problems
-
20491 Solvers
-
2267 Solvers
-
6535 Solvers
-
Back to basics 12 - Input Arguments
549 Solvers
-
Celsius to Fahrenheit converter
486 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!