Cody

Problem 385. Poker Series 09: IsHighCard

Solution 2182459

Submitted on 30 Mar 2020
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 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 = true; y_correct.usedCards = logical([0 0 0 0 0 0 0 0 1 1 0 1 1 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 0 0 0]) assert(isequal(isHighCard(hm),y_correct))

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

Unrecognized function or variable 'hm1'. Error in isHighCard (line 2) [hand,val] = getBestHand(hm1); Error in Test1 (line 12) assert(isequal(isHighCard(hm),y_correct))

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

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

Unrecognized function or variable 'hm1'. Error in isHighCard (line 2) [hand,val] = getBestHand(hm1); Error in Test2 (line 12) assert(isequal(isHighCard(hm),y_correct))

3   Fail
hm = [0 1 0 0 0 0 0 0 1 1 0 1 1 1 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 1 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 1 1 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 0 1 0 0 0 0 0 0 0 0 0 0 0 0]) assert(isequal(isHighCard(hm),y_correct))

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

Unrecognized function or variable 'hm1'. Error in isHighCard (line 2) [hand,val] = getBestHand(hm1); Error in Test3 (line 12) assert(isequal(isHighCard(hm),y_correct))

4   Fail
hm = [0 0 0 0 0 0 0 0 1 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 0 1 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(isHighCard(hm),y_correct))

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

Unrecognized function or variable 'hm1'. Error in isHighCard (line 2) [hand,val] = getBestHand(hm1); Error in Test4 (line 12) assert(isequal(isHighCard(hm),y_correct))