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 commentsGroup

Card Games
- 18 Problems
- 25 Finishers
- Card Game
- SET (the card game)
- Poker Series 01: isStraightFlush
- Mongean Shuffle : 2
- Mongean Shuffle
- Combine Cards to make 21
- Poker Card Deal!
- Clock Solitaire
- SET (the card game)
- Poker Series 11: selectBestHand
- Poker Series 10: bestHand
- Poker Series 09: IsHighCard
- Poker Series 08: IsPair
- Poker Series 07: IsTwoPair
- Poker Series 06: isThreeKind
- Poker Series 05: isStraight
- Poker Series 04: isFlush
- Poker Series 03: isFullHouse
- Poker Series 02: isQuads
- Poker Series 01: isStraightFlush
Problem Recent Solvers121
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!