Cody

Solution 2166380

Submitted on 20 Mar 2020 by Swapnil Dongare
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
a= ['* ' '** ' '*** ' '**** ' '*****'] assert(isequal( star_pattern(5,'bl'),a))

a = 5×5 char array '* ' '** ' '*** ' '**** ' '*****' last = ' '

2   Pass
a= [' *' ' **' ' ***' ' ****' ' *****' '******'] assert(isequal( star_pattern(6,'br'),a))

a = 6×6 char array ' *' ' **' ' ***' ' ****' ' *****' '******' last = ' '

3   Pass
a= ['****' ' ***' ' **' ' *'] assert(isequal( star_pattern(4,'tr'),a))

a = 4×4 char array '****' ' ***' ' **' ' *' last = ' '

4   Pass
a= [ '**********' '********* ' '******** ' '******* ' '****** ' '***** ' '**** ' '*** ' '** ' '* '] assert(isequal( star_pattern(10,'tl'),a))

a = 10×10 char array '**********' '********* ' '******** ' '******* ' '****** ' '***** ' '**** ' '*** ' '** ' '* ' last = ' '

5   Pass
a= [ '***************' ' **************' ' *************' ' ************' ' ***********' ' **********' ' *********' ' ********' ' *******' ' ******' ' *****' ' ****' ' ***' ' **' ' *'] assert(isequal( star_pattern(15,'tr'),a))

a = 15×15 char array '***************' ' **************' ' *************' ' ************' ' ***********' ' **********' ' *********' ' ********' ' *******' ' ******' ' *****' ' ****' ' ***' ' **' ' *' last = ' '