Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 'Morse code is FUN!';
y_correct = '-- --- .-. ... . -.-. --- -.. . .. ... ..-. ..- -. -.-.--';
assert(isequal(MorseCodeGenerator(x),y_correct))
Morse_code_out =
'-- --- .-. ... . -.-. --- -.. . .. ... ..-. ..- -. -.-.--'
|
2 | Pass |
x = 'Am I 20, (who knows?)';
y_correct = '.- -- .. ..--- ----- --..-- -.--. .-- .... --- -.- -. --- .-- ... ..--.. -.--.-';
assert(isequal(MorseCodeGenerator(x),y_correct))
Morse_code_out =
'.- -- .. ..--- ----- --..-- -.--. .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
|
3 | Pass |
x = 'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: or does he...';
y_correct = '- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .-. - .... . .-.. .- --.. -.-- -.. --- --. ---... --- .-. -.. --- . ... .... . .-.-.- .-.-.- .-.-.-';
assert(isequal(MorseCodeGenerator(x),y_correct))
Morse_code_out =
'- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .-. - .... . .-.. .- --.. -.-- -.. --- --. ---... --- .-. -.. --- . ... .... . .-.-.- .-.-.- .-.-.-'
|
4 | Pass |
x = '1234567890';
y_correct = '.---- ..--- ...-- ....- ..... -.... --... ---.. ----. -----';
assert(isequal(MorseCodeGenerator(x),y_correct))
Morse_code_out =
'.---- ..--- ...-- ....- ..... -.... --... ---.. ----. -----'
|
The Goldbach Conjecture, Part 2
1286 Solvers
487 Solvers
Determine if a Given Number is a Triangle Number
322 Solvers
Join Strings with Multiple Different Delimiters
83 Solvers
Given a 4x4 matrix, swap the two middle columns
516 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!