Draft
Morse Code (translate text to and from morse code)
18 of 61dinomight
Loading description...
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
This comment has been hidden.
There are multiple "morse code" katas already on CW... *sigh*
Notes for ruby and python:
Test.expect
, useTest.assert_equals
insteadtranslate_to_morse
instead oftranslateToMorse
Would recommend replacing the table in the description with something much more compact like an image similiar to this.
Done.
Ok i refactored, put the arrays in the preload, did better testing including additional complete random tests. I also added how to use the preload and a primer on how arrays are created and used in each of the langagues. That way they learn arrays without having to create those giant arrays of codes and characters. I also upgraded this to a level 7kyu. What do you guys think. I had put in the accented characters but it becaume too dificult since php and python wouldn't handle multibyte strings easily. Better to pull those out than have the user try to figure out why the accented characters weren't work, and have to figure out why they can't use native multibyte string manipulation through the mb_ commands (since it isn't installed in the php build used in codewars).
One mark two characters ? And it is not tested. Actually most of the
Punctuation Marks
are not tested.You are right about brackets in morse code there is no distinction between "(" and ")". Also i didn't get all of the testing correct. As i wrote version in more languages i started testing better, but i found that documentation and implementation varied vastly between languages. This is my first kata, so i'm trying to figure this all out. I'll go back and adjust the tests and make it a little more clear that brackets "()" are the same in the instructions.
A clarification has been added to the description. testing is now a complete test.
Kata is a duplicate of this (except for the inverse function), and the description doesn't accurately describe the task to be completed.
It's not an exact duplicate because of the extra symbols at the end of the code table. None of the existing katas you have to handle them.
I have altered the description to better describe the kata. I also noticed that I forgot to mention that all text is in lowercase. as Voile stated I have included punctiation/symbols, and I do expect them to be able to translate to and from morse code. I am considering adding the international symbols such as Ä .-.- Á .--.- Å .--.- Ch ---- É ..-.. Ñ --.-- Ö ---. Ü ..-- But although the addition of these characters is simple i felt it was probably a bit much for a 8kyu. Also i just added ruby. As a question for others, should i include the arrays all filled in as part of the initial solution (it's a pain in the but to create them) I've gone back and forth on that one. Any input would be appreciated. This is my first kata and is an attempt to teach Boy Scouts the basics of several languages as part of the programming merrit badge. And hopefully get them excited to play with code wars. I already have one scout complete the kata in javascript and all day he has been trying to do other katas all on his own. It's very cool to see someone get excited about programming so quickly
Accented characters became much to difficult for the level I wanted for this kata, so i pulled that out.