Problem 329. Poker Series 01: isStraightFlush
Solution Stats
Problem Comments
-
8 Comments
Very late here since the last comment, but if you care to update, my code passed all the tests but it ran into an error when dealing with a normal flush. May want to put a test in there for five 1's in a single row but not consecutive
So, just to clarify, because in normal poker, 9 10 J Q K beats A 2 3 4 5, at least I think and an online simulator proved that to be correct...
in your case, A high beats K high? I might need to analyze the expected answers a bit but you did say in your problem statement that A high trumps, so I just wanted to check
If you are starting the Poker Series, consider including a score for the hand in your code. Problems 1-9 will allow you to identify the hand types (flush, straight, quads, etc.) in problem 10, but in problem 11 you will need a way to break ties between two straights, two full houses, two flushes, etc. For this problem, for example, the score could simply be the high card of the straight flush.
Solution Comments
Show commentsProblem Recent Solvers121
Suggested Problems
-
2283 Solvers
-
Reverse the Words (not letters) of a String
450 Solvers
-
162 Solvers
-
Unique values without using UNIQUE function
371 Solvers
-
5500 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!