Cody

# Problem 329. Poker Series 01: isStraightFlush

Solution 1236474

Submitted on 21 Jul 2017
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
hm = [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 0 0 0 0 0 0 0]; y_correct.flag = true; y_correct.usedCards = logical([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 0 0 0 0 0 0 0]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 1 usedCards: [4×13 logical]

Error using horzcat Dimensions of matrices being concatenated are not consistent. Error in isStraightFlush (line 5) out.usedCards = [ind(:,1) | ind(:,end), ind(2:end-1)] ; Error in Test1 (line 11) assert(isequal(isStraightFlush(hm),y_correct))

2   Fail
hm = [0 0 0 0 0 0 0 0 1 1 0 1 1 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]; y_correct.flag = false; y_correct.usedCards = logical([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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 0 usedCards: [4×13 logical]

Error using horzcat Dimensions of matrices being concatenated are not consistent. Error in isStraightFlush (line 5) out.usedCards = [ind(:,1) | ind(:,end), ind(2:end-1)] ; Error in Test2 (line 11) assert(isequal(isStraightFlush(hm),y_correct))

3   Fail
hm = [0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 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]; y_correct.flag = true; y_correct.usedCards = logical([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 0 0 0 0 0 0 0 0 0 0 0 0 0]) assert(isequal(isStraightFlush(hm),y_correct)) hm = [0 0 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0]; y_correct.flag = true; y_correct.usedCards = logical([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 0 0 0 0 0 0 0 0 0 0 0 0 0]) assert(isequal(isStraightFlush(hm),y_correct))

y_correct = struct with fields: flag: 1 usedCards: [4×13 logical]

Error using horzcat Dimensions of matrices being concatenated are not consistent. Error in isStraightFlush (line 5) out.usedCards = [ind(:,1) | ind(:,end), ind(2:end-1)] ; Error in Test3 (line 11) assert(isequal(isStraightFlush(hm),y_correct))