Cody

# Problem 376. Poker Series 05: isStraight

Solution 98625

Submitted on 14 Jun 2012
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   Pass
%% hm = [0 1 0 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 1 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(isStraight(hm),y_correct))

``` y_correct = flag: 0 usedCards: [4x13 logical] y_correct = usedCards: [4x13 logical] aces = 1 toinspect = Columns 1 through 10 2 0 1 0 0 0 0 3 1 0 Column 11 2 colonewith2 = 2 12 line2setzero = 6 A = Columns 1 through 10 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 1 0 0 0 0 1 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 0 0 0 0 0 0 0 Columns 11 through 13 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 s = 20100003102 y = 2 loc = 6 y_correct = usedCards: [4x13 logical] flag: 0 ```

2   Pass
%% hm = [0 1 1 0 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 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; y_correct.flag = true; y_correct.usedCards = logical([0 1 1 0 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 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]) assert(isequal(isStraight(hm),y_correct))

``` y_correct = flag: 1 usedCards: [4x13 logical] y_correct = usedCards: [4x13 logical] aces = 0 toinspect = Columns 1 through 10 1 1 1 1 1 0 0 0 1 0 Column 11 1 colonewith2 = Empty matrix: 1-by-0 line2setzero = Empty matrix: 0-by-1 A = Columns 1 through 10 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 Columns 11 through 13 0 0 0 0 0 0 0 1 0 0 0 0 s = 11111000101 y = 5 loc = 1 y_correct = usedCards: [4x13 logical] flag: 1 y_correct = usedCards: [4x13 double] flag: 1 ```

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

``` y_correct = flag: 1 usedCards: [4x13 logical] y_correct = usedCards: [4x13 logical] aces = 0 toinspect = Columns 1 through 10 2 1 1 1 1 0 0 0 1 0 Column 11 1 colonewith2 = 2 line2setzero = 3 A = Columns 1 through 10 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 Columns 11 through 13 0 0 0 0 0 0 0 1 0 0 0 0 s = 21111000101 y = 5 loc = 1 y_correct = usedCards: [4x13 logical] flag: 1 y_correct = usedCards: [4x13 double] flag: 1 ```

4   Pass
%% hm = [0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0]; y_correct.flag = true; y_correct.usedCards = logical([0 1 1 0 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 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0]) assert(isequal(isStraight(hm),y_correct))

``` y_correct = flag: 1 usedCards: [4x13 logical] y_correct = usedCards: [4x13 logical] aces = 1 toinspect = Columns 1 through 10 2 1 1 1 1 0 0 0 1 0 Column 11 1 colonewith2 = 2 line2setzero = 3 A = Columns 1 through 10 0 1 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 Columns 11 through 13 0 0 0 0 0 0 0 1 0 0 0 0 s = 21111000101 y = 5 loc = 1 y_correct = usedCards: [4x13 logical] flag: 1 y_correct = usedCards: [4x13 double] flag: 1 ```

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

```Error: Assertion failed. ```