Cody

Solution 1260002

Submitted on 31 Aug 2017 by Jan Orwat
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
board = 'OXO'; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

2   Pass
board = ''; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

3   Pass
board = ' '; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

4   Pass
board = ' X '; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

5   Pass
board = 'O O'; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

6   Pass
board = 'O O OXO X'; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

7   Pass
board = 'OOX'; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

8   Pass
board = 'OOXOX'; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

9   Pass
board = 'OOX OX'; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

10   Pass
board = 'OOXXO'; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

11   Pass
board = 'OOXOOOOXXOXOX'; y_correct = 2; assert(isequal(count_OXO(board),y_correct))

12   Pass
board = ['OOO';'OXO';'OXO']; y_correct = 4; assert(isequal(count_OXO(board),y_correct))

13   Pass
board = ['OOO';'OXO';'OOO']; y_correct = 4; assert(isequal(count_OXO(board),y_correct))

14   Pass
board = ['OXX';'XXX';'XOO']; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

15   Pass
board = ['OOO';'X O';'OXO']; y_correct = 2; assert(isequal(count_OXO(board),y_correct))

16   Pass
board = [' ';' ';' ';' ']; y_correct = 0; assert(isequal(count_OXO(board),y_correct))

17   Pass
board = ['O OO';'O XO';'OOX ']; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

18   Pass
board = ['OXXOXO';' OXO X';'XOXOXO']; y_correct = 6; assert(isequal(count_OXO(board),y_correct))

19   Pass
board = ['OXOXOXO';'OXOXO X';'XOOOXOX']; y_correct = 8; assert(isequal(count_OXO(board),y_correct))

20   Pass
board = 'OXO'.'; y_correct = 1; assert(isequal(count_OXO(board),y_correct))

21   Pass
% Keep in mind that Test Suite may be extended, so try to write general solution. % If you find any bugs, please report it to me. Thanks! % Have fun.

Suggested Problems

More from this Author47