Cody

Problem 45369. Sky full of stars - 02

Solution 2168047

Submitted on 21 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
a= ['*********' ' ******* ' ' ***** ' ' *** ' ' * ']; assert(isequal(star_pattern_2(5,'t'),a))

y = '*********' y = ' ******* ' y = ' ***** ' y = ' *** ' y = ' * '

Assertion failed.

2   Fail
a= [' * ' ' *** ' ' ***** ' ' ******* ' ' ********* ' ' *********** ' ' ************* ' ' *************** ' ' ***************** ' '*******************']; assert(isequal(star_pattern_2(10,'b'),a))

y = '*******************' y = ' ***************** ' y = ' *************** ' y = ' ************* ' y = ' *********** ' y = ' ********* ' y = ' ******* ' y = ' ***** ' y = ' *** ' y = ' * '

Assertion failed.

3   Fail
a= ['*************************' ' *********************** ' ' ********************* ' ' ******************* ' ' ***************** ' ' *************** ' ' ************* ' ' *********** ' ' ********* ' ' ******* ' ' ***** ' ' *** ' ' * ']; assert(isequal(star_pattern_2(13,'t'),a))

y = '*************************' y = ' *********************** ' y = ' ********************* ' y = ' ******************* ' y = ' ***************** ' y = ' *************** ' y = ' ************* ' y = ' *********** ' y = ' ********* ' y = ' ******* ' y = ' ***** ' y = ' *** ' y = ' * '

Assertion failed.

4   Pass
a= ['*']; assert(isequal(star_pattern_2(1,'t'),a))

y = '*'

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!