Cody

Problem 1686. Generate a melodic contour string matrix

Solution 2739697

Submitted on 25 Jul 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
str = '*rrr'; melody = '*-*-*-*'; assert(strcmp(parsons(str),melody))

Output argument "melody" (and maybe others) not assigned during call to "parsons". Error in Test1 (line 3) assert(strcmp(parsons(str),melody))

2   Fail
str = '*du'; melody = ['* *' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

Output argument "melody" (and maybe others) not assigned during call to "parsons". Error in Test2 (line 5) assert(strcmp(parsons(str),melody))

3   Fail
str = '*ruuddduur'; melody = [' * ' ' / \ ' ' * * *-*' ' / \ / ' '*-* * * ' ' \ / ' ' * ']; assert(strcmp(parsons(str),melody))

Output argument "melody" (and maybe others) not assigned during call to "parsons". Error in Test3 (line 9) assert(strcmp(parsons(str),melody))

4   Fail
str = '*rududdrudud'; melody = [' * * ' ' / \ / \ ' '*-* * * * * ' ' \ / \ / \ ' ' *-* * *']; assert(strcmp(parsons(str),melody))

Output argument "melody" (and maybe others) not assigned during call to "parsons". Error in Test4 (line 7) assert(strcmp(parsons(str),melody))

5   Fail
str = '*rururddrdrdrd'; melody = [' *-* ' ' / \ ' ' *-* * ' ' / \ ' '*-* *-* ' ' \ ' ' *-* ' ' \ ' ' *-* ' ' \ ' ' *']; assert(strcmp(parsons(str),melody))

Output argument "melody" (and maybe others) not assigned during call to "parsons". Error in Test5 (line 13) assert(strcmp(parsons(str),melody))

Suggested Problems

More from this Author50

Community Treasure Hunt

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

Start Hunting!