Cody

# Problem 45368. Sky full of stars - 01

Solution 2166729

Submitted on 20 Mar 2020 by James
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 '* ' '** ' '*** ' '**** ' '*****' cy = 5×5 char array '* ' '** ' '*** ' '**** ' '*****'

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

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

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

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

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

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

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

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

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!