8 kyu
DNA to RNA Conversion
52,475 of 153,749torret
Loading description...
Fundamentals
Strings
View
Career Accelerator
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.
ooooooo! I'm so happy. It's the second Kata i solved by myself.
"'TTTTUUUUU' should equal 'UUUU' 'GCATUU' should equal 'GCAU'"
Say what now? I thought this was supposed to be just about converting Ts to Us. What is this?
Your algorithm is not correct. You append an 'U' for every 'T' (not exactly, actually it's even weirder but you get the point).
Not a kata issue.
the issue here is probably not about whether their solution is correct, but that the test output itself can (if misreading, but reasonably so) seem to contradict the instructions (as it may seem to claim that 'TTTTUUUUU' was the input)
..which I agree with. this is poor wording which assumes a different context for the solver than the solver is actually in
Well the assertion messages of Python test framework are suboptimal.
This comment has been hidden.
Please do not post your solutions in kata discourses. It's not necessary, and they are spoilers.
This comment has been hidden.
What do you mean? It's just replacing the character T with the character U.
Prolog translation
Approved by someone
Lua translation!
Approved
bad kata, bad science, bad everything, be better.
This comment has been hidden.
This cata is deeply wrong. Biological sequenses do not behave themself on transcription such a way. G always equals C in both DNA and RNA. A = U in RNA, but T transcripts into A in RNA. So compare that and cata! Science must be science. Take this cata away or figure out the topic!
You spelled "Kata" wrong. Twice.
Thus, your argument is invalid. The kata stays.
Good day, sir.
Doesn't matter
I mean if it's just for code that'll do
This comment has been hidden.
funny how two lines of code just solved this question using python. How many lines was yours, and which language?
COBOL: 27 lines
in javascript you can easily make it harder for your self by using arrays and methods, work smart not hard , stick to the basics and ' go through each letter ' ;).
Not a kata suggestion. See https://docs.codewars.com/training/troubleshooting#post-discourse.
This comment has been hidden.
See if this paragraph helps.
This comment has been hidden.
Thank you for responding!
This comment has been hidden.
Please use appropriate formatting when posting code. See https://docs.codewars.com/training/troubleshooting/#post-discourse.
You're printing instead of returning. See https://docs.codewars.com/training/troubleshooting#.print-vs-return and https://docs.codewars.com/training/training-example/.
@NunoOliveira, thanks! It works now, will use the formatting for future posts.
This comment has been hidden.
You're printing/logging the answer instead of returning it.
Honestly, I never considered just replacing occurrences of 'T' in the argument with 'U', but I guess that would be more efficient than the method I used. I turned the argument into a character array using toCharArray() and added each character to a new string unless it was theh character 'T' in which case I added 'U'. You gotta work smarter not harder though.
Hey everyone :) My code runs on the sample tests, but fails at the random tests. The error message keeps telling me, that a couple of random tests work. At some point, at the end of my rna string is an additional letter attached, which causes this test to fail. So far, it's always been an "1" or an "A". I can't reproduce it on the given tests and ran out of ideas by now. Any suggestions what it could be? I use C.
your returned string is not nul terminated, you need to allocate one more byte
Thanks a lot, now all tests are successful.
Does this mean, before there have random '\0' been at the end of my intended string? So it was just luck, that they were still there and not overwritten?
yes, in the sample tests you were "lucky" that the next byte in memory after your string happened to be a
\0
. behind the scenes, your string will be compared to the expected answer with thestrcmp()
function. when it is not a\0
byte,strcmp
will conclude that your string is longer than (and therefore not equal to) the expected answer. then the tests suite will print your string in the assertion message, and this is where you see the extra characters at the end: they are whatever happened to be in memory after your string at this point.C sounds painful.
This comment has been hidden.
This comment has been hidden.
RISCV Translation
I'm not so keen on the lack of camelCase for the function name, but that's just OCD :'D
Great Kata, thank you.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Don't post solutions in Discourse, please.
Remove this bs chemistry DNA and etc, remove useless water text, it's all about programming....
.
This comment has been hidden.
you are correct , The kata does not convert the dna to rna. It just replaces thymine to uracil which is wrong.
This comment has been hidden.
Hi @punkbibi and welcome to Codewars!
I note that you have now solved this kata - please in future:
don't raise Issues lightly; they are reserved for serious problems with the kata (not just bugs in your code)
at least return to your open Questions/Issues and resolve them yourself once you find the answer, to avoid leaving open Issues for moderators to work on.
also - please use Spoiler flag whenever you post code on Codewars site - otherwise you will spoil the kata for people who have not solved it yet.
In this case, it seems like your function was called
def ki(dna):
rather thandef dna_to_rna(dna):
so it was just a simple case of using the expected function name? Glad you solved it anyways, and good luck on your Codewars journey!edit - I just notice that your original code had:
return print...
- that was probably causing the mistake - you just need to usereturn your_result_goes_here
.thank you, and i will sure be more carefule, while writing code and my questions.
C lang : My solution is passing the test but failing the attempt. When it fails the attempt it is because on longer strings in the ACTUAL return it is giving a load of garbage characters at the start and then the rest of the response matches the expected.
When I add code in to shift the pointer to start after these garbage characters I then get pointer error.
I figured out why this was happening for me. I was trying to add a null pointer to the end of the buffer using the strlen() call, but, obviously, as there wasn't a null pointer in the buffer already, strlen just went until the most recent pointer and added one in the same place.
Quite a nice start to the journey :)
Welcome to Codewars and good luck on your journey!
That one was easier than I thought.
This comment has been hidden.
Hi; I don't use JavaScript but I noticed that this question has been answered recently for another user by @Chrono79 - here is the link to his comment:
https://www.codewars.com/kata/5556282156230d0e5e000089/discuss#633735af7072100030958b37
You might not have been able to see the original comment as it is Spoilered.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
Fixed. (Was only a problem in C++)
This comment has been hidden.
About the error:
replaceAll
requires a higher Node version, so you'll have to use another thing or wait until Node 16 is enabled (no ETA for this).Your function should return the result, not print to the console. Read this: https://docs.codewars.com/training/troubleshooting
Thanks for the reply and update.
Scala Translation
.
C: Since this is a beginner level kata the initial solution setup should tell the user about manually allocating a buffer and return it.
Added a corresponding note, please verify.
Verified.
Great beginning!
Good 'ol bioinformatics :)
This comment has been hidden.
Because your if condition is wrong and it always evaluates to True
but 'if' is true when the string is "i" or "e", then when looping the string "a", it will not enter the conditional if and will continue below it.
This comment has been hidden.
It requires Node v15 or higher. Check the posts already here before creating your own, it's already asked and answered.
This comment has been hidden.
you are not supposed to call the function on your own
you just need to return the answer from within the function with
return result
oh, thank you)
This comment has been hidden.
Not until Node v15 is available, no.
Good to know brother! Cheers
This comment has been hidden.
due to latest Node Version not vailable yet, not an issue
Ah, got it. Thank you!
I love the concept here. However, to be more true to reality each of the bases should be changed into its complement. A's complement will be U rather than T. C -> G G -> C T -> A A -> U
Anyways I am a big fan of genetics. The question didn't talk about transcription. You know, the process whereby DNA strands are transcribed to RNA for translation at the ribosomes. If it were so, then AAATCAGGA will be transcribed to UUUAGUCCU and to be even more precise, taking the molecular properties into consideration, starting from 5' to 3', then it will be UCCUGAUUU. Lol, that is to be extremely realistic. Codewar just kept it simple and in my opinion it's ok. Thanks
Exactly... as a med student I was thrown off when my code didn't work at first.
C# Function name should use
PascalCase
This comment has been hidden.
Nodev14, which is the highest Node.js version that you can use in this kata, does not support the String.prototype.replaceAll() method.
This comment has been hidden.
Please use a spoiler flag when you post code, so that users who didn´t solve the kata cannot see it; I put the flag for you this time. Also use markdown tags to format your code or it's not usable. Refer to the documentation about this and more: https://docs.codewars.com/training/troubleshooting/#post-discourse
Moreover, we don't even know which language you are using. If it's JavaScript and the function you're trying to use is not recognized, then you must try to find another way to do the same because it is not supported in the NodeJS version currently available on Codewars. Search for the documentation online and you should find easily a substitute. If it's not the problem, you need to provide more information.
Does anyone know why dna.splice(3, 1, 'U') is not a function? Im using Javascript
The inputs are strings,
splice
works on arrays only (strings are immutable in Javascript, so you need to find another way: convert them to arrays or generate directly the output string).This comment has been hidden.
Please refer to the documentation to format your code: https://docs.codewars.com/training/troubleshooting/#post-discourse
Also please state which language you're using when asking for help.
This comment has been hidden.
works a treat in my IDE but only passes three tests in here. when i use the input from the failed tests, i get the right(exoected) output...confused.com lol ps its with Java
"Works on my IDE" is not a kata issue. The problem is that you just have hardcoded two sample test cases. Your method should work with arbitrary DNA strings as input.
This comment has been hidden.
You are allowed to use all the tools your language of choice provides to you (as long as you are not manipulating the test framework). If you want to use them or rather want to write everything yourself depends on your personal preference and training goals.
The title is misleading. A DNA sequence is transformed into RNA through the transcription process which involves the replacement of all nucleic acids in the DNA strand into their complement but with the thymine (T) replaced by uracil (U). Maybe if that aspect was reflected in this kata, it might have increased its difficulty and involved more thinking.
can't load package: package codewarrior/kata: solution.go:4:10: expected 'STRING', found newline
Getting this error. Is there problem in my code or kata. Can someone help?
It would be more interesting if this kata was about full transcription.
This comment has been hidden.
This comment has been hidden.
Not an issue. Current JS uses Node V.14 ~~
then what to do?
This comment has been hidden.
same problem
C#
If you don't know a Linq, then you'll think it's 7kyu
COBOL translation (author inactive).
Approved
CS, JS and TS function name should be in
camelCase
Anyone know what I'm suppose to use in this one for java?
Maybe Codewars can have 9 and 10 kyu ranks for really easy kata, such as this one?
That's already 8 kyu.
Some of the test string in C don't have null terminators, making this challenge impossible unless you specifically test for those strings, those being "ATACGTGAATAATACT" in normal test cases and "GTACACTAGTAATATTTCTTTCGCGTTCTGT" in random test cases
All C test strings have null terminators. Are you sure that your solution is correct? You may post your solution in a comment with a spoiler tag. Or you may ask questions here.
This comment has been hidden.
And how is the string returned by your solution null terminated?
oh
No random tests in
Maybe the word 'translate' could be changed to 'convert', to avoid confusion with the biology term translation.
clojure translation for review
https://www.codewars.com/kumite/5fb6f50ff0f635000d50e65c?sel=5fb6f50ff0f635000d50e65c
This task is 7 not 8
This comment has been hidden.
You are printing the result instead of returning it.
Also, please use markdown formatting when posting code, otherwise it is really hard to read. ;)
This comment has been hidden.
After my 4th attempt I solve.
This comment has been hidden.
You can find some suggestions here.
This comment has been hidden.
This comment has been hidden.
Tried three times. Only solved it once I got rid of all my code, and tried to solve it in the most simple way.
This comment has been hidden.
Mark your post as having spoiler content next time. Read the kata description again, you only need to change one letter.
Python method name must be written in snake case. (as of PEP8) Rename DNAtoRNA to dna_to_rna
P.S.: If someone ever comes to edit this, do it in a way that does not invalidate everything.
Fixed.
This comment has been hidden.
Ruby method name must be written in snake case. Rename
DNAtoRNA
todna_to_rna
P.S.: If someone ever comes to edit this, do it in a way that does not invalidate everything.
Fixed.
Python - Needs random tests
added
There is a typo in the description: "Create a func[TI]on which translates a given DNA string into RNA."
fixed
Hi, I have a problem with my answer. When I execute my code in my terminal, it prints correct translation from dns to rna but when I run my code in here these extra characters(��) are added to end of my return value. Othervice the return value is correct. Have anyone any idea what is going on?
If you post your answer, other people might be able to help. You can use Markup to format it, and then click the "spoiler content" box since your code is a solution.
This comment has been hidden.
Racket translation
Dart translation Julia translation PHP translation
Bump.
Can somebody help me? My code seems to behave correctly when I test it in a different IDE; and it passes all sample tests when I click the "run sample tests" button. However, when I hit ctrl+s or try to run the full test suite, I get an error. The last string in each test fails because my program returns more letters than there are in the string.
This comment has been hidden.
Though cute, this Kata would have been cuter if the DNA was correctly transcribed into a complementary RNA strand, i.e. (G -> C, C -> G, T -> A, A -> U)
this is hard
Also... fuck you, FArekkusu, the "C Programming Expert" is either a fucking dunce, or something you made up, just so you can be a fucking asshole to somebody in comments again.
As much as I am equally annoyed by the "Appeal to an Authority Figure" as I am to the whole "Distrust all Proported Authority Figures"... the fact you've thrown that off hand once... and then hit the solve issue button without having that supposed real life--and not at all imaginary or fucking delusional--C Programmer Expert to tip their hat in... just has me even more irritated with you... and honestly...
IT would be so much fucking better, if when people were having issues, that YOU FArekkusu were to just shut the fuck up--and not proceed to come in and be a fucking rude piece of burning landfill dumpster fire that you are in EVERY FUCKING INTERACTION you have on this website. You provide nothing of any clarification or help when you type--so much as just condescending assholish responses--that you have a large tendency to be completely fucking incorrect about.
Also... hitting as issue over the Kata... as there really does not seem to be a better way to point out this as being an issue--and various other attempts that other social media websites have attempted to deal with this scenario only seem to further exacerbate it.
Look... I get that you've gotten up to 1kyu... but you fucking suck at interacting with people. Even in a text based interaction... and every fucking interaction you do, is mixed with you making the interaction worse--and often you spouting off incorrect statements and informations while just coming across as literally the fucking worse. Please... just... please... lay off of it for a bit. There are other people who do these matters better, solve matters more effectively and do not have people thinking they are dealing with a total fucking asshole. If you see an issue/suggestion or anything that requires you to interact with a human... maybe get somebody who is capable of resembling a person to do this instead?
Go complain about this on the CW official repo. Kata comments are not for calling out specific users.
Also, can you stop behaving like a snowflake? It's just a program crashing. Why are you acting like he has killed your mom or something?
The CW Official Repo is also not for calling out specific users either. So your suggestion is fucking busy work nosnense.
What the fuck does that even mean? What the fuck does "acting like a snowflake mean" actually mean?
I've heard people say it... and I thought I knew what it meant... but then people kept saying it... and... it... it does not make any fucking sense.
It is just noises people keep fucking making.
Uh... what the fuck are you talking about?
My being slightly irritating with FArekkusu being fucking human garbage in literally every interaction he has, literally interfering with things happening on the website has nothing to do with the program crashing.
My being slightly irritated with FArekkusu being a flaming landfill of human excrement has to do with him literally being the fucking worse to have reply to a comment... and it just being something that just keeps happening.
The issue with the core dump... is that it reveals a lot of information about the container that the C solution is being run into--and while it might require a few hoops to jump through--it is possible for this to be exploited by people who would use Codewar as a node in other internet exploits... I literally have no way to explain that without having the words sound silly.
But the issue of the core dump is not an issue with FArekkusu... which is rather simple and easy to follow and comprehend... or so I would have thought.
Go report that to https://github.com/Codewars/codewars-runner-cli/issues.
Also, if you don't like a particular user, stop complaining about it in the comments, we had too much of this before and it always gets out of hand and become extremely ugly. Kata comments are for katas, not for your social interactions, so get it elsewhere. Don't care where you get it to, just don't post it in the kata comments. Thank you for your cooperation.
This comment has been hidden.
Learn how to fucking read FArekkusu, you fucking dejectable human piece of shit to interact with on this website.
The issue is not just that my "solution crashes"... it is that it crashes in random and unpredictable manners. It will actually run through the sample test cases fine... and will go through a fair amount of the random test cases before it just decides to give a core dump--with an error that really does not tell me what is going on.
What is more... the website is giving me a fair amount of "success information" before OUT OF NOWHERE it crashes without any reason given.
The fact I've stated, that I can get rather far into the random tests before it crashes should have fucking clued you in, to why what you are saying is fucking stupid nonsense bullshit, you giant fucking aggrevating douche bag to work with.
No... the issue is not fucking solved. Please, do not hit "issue solved" simply because you are too fucking basic to follow a simple interaction.
Especially when part of what the issue is, involves a possible security issue with CodeWars.
That is... assuming it is not that the test cases do not misapply "free()" in a way, that could cause issues for the person doing the C version of the Kata--if the person doing the C solution.
You can keep ranting about this all you want, but at it currently stands you're even less helpful because we can't reproduce the results. At least you should post your code with spoilers.
By the way, have you actually allocated space for your strings and null-terminated them? If you aren't then you deserve to get a segfault yourself. It's a rookie mistake, you know ;-)
Not allocating space does not get the strings to pass the sample tests.
Since I am passing the sample tests... it seems that yes, I have to be doing that.
Also... unless CodeWars is using a special version strcpy, it is also being null-terminated.
So it is neither of those rookie mistakes. That is not an indication it is not yet another in a long list of rookie mistakes.
That being said... already your statement of null termination and allocating space is already a bit more productive than what I've had with the other person I am really annoyed with.
A previous interaction I had, had somebody at a higher rank, mocking me, telling me that "my incorrect code is completely visible to everybody who works on stuff on the website"... I cannot remember who it is for certain, so my desire to blame you know who cannot be substantiated...
But that statement from somebody (who, I honestly cannot remember who it was--which just sounds fucking passive aggressive as fuck... and that just makes saying it even worse) is why I've not posted that as part of spoiler code.
Also... wasn't there a version of the comment system, that if I were to do that, I'd not be able to see any replies made to that comment?
Well, that's exactly because you forgot to mark it as spoilers... Which is easy to fix: mark spoilers as spoilers next time ;-)
Nope, it only applies to notifications. You can still see the comments.
Reality is... before raising an issue you should PROPERLY investigate what's happening instead of saying "I think something is broken, but I don't know, and don't want to know as well". And C is not Python/JavaScript/PHP or whatever languages you do - if you fuck something up, you should be happy if you received ANY hint on what you're doing wrong.
Your original issue made no sense neither as a kata issue (because you yourself don't know whether there's anything wrong with the kata) nor as a CW issue (because these should be reported on github). As of your behavior - congrats on being reported for breaking the Code of Conduct :+1:
So... you CAN see my code attempt then?
Then why are we having this interaction?
Ah... for some reason I thought there was this behaviour on the forum in the past.
Edit: fixed mark up that appears to require two line breaks.
No, we can't see you attempt unless you post your code. Pleas read carefully what others said ;-)
Oh... gog... this fucking asshole.
I very CLEARLY did do that.
You're responding like I did, kind of demonstrates that you are being a bit of a dishonest douche bag.
Fuck you. Just... fuck you.
I am saying fuck you... because you just said "fuck you" back to me. You just did so in a very dishonest, liar type way.
That being said... we are not using C compilers from the 1970s here. So, that response is you just stating meaningless bullshit to be a disingenious asshole.
Even then... if that were true (it is not) then what is the point of the criterion testing suite being used?
Clearly, under what you are saying, that should just be fucking tossed out like so much freaking rubbish.
But hey... let's be real... you are just spouting fucking nonsense again.
Just because you have the ability to follow things being said to you akin to a gold fish that has eaten an amount of paint chips as to not be fatal does not mean the things you read do not make sense.
I should just jump to conclusions then? That is the proper response then?
Well, you seem to fucking do that in EVERY INTERACTION you seem to have. My god, the gaul you have on you when you interact with people. Especially when your conclusions make no sense and actually go against other things you've stated.
Considering my code broke when run against a set of code that was not visible to me... it would be warranted to double check there is not an issue in the hidden code I accidentally ran into.
And... another person told me that it is something that could be reported onto github... but I do this silly thing of not jumping to the most ridiculous conclusion first.
Something you seem to be completely at odds with.
So... you admit you are just trolling people, and had no intention of actually helping people.
Good to know, that none of your interactions have ever been genuine or mean to do anything other than you to just be a fucking total douche bag.
Also... my behaviour is completely fine... you, on the other hand... only TECHNICALLY follow the Code of Conduct. Which is actually worse than breaking it.
edit: reminder, mark up seems to require two line breaks.
Uh... dude man, the one not reading carefully appears to be you.
I flat out said something... you then replied with something that did not actually acknowledge the statement I said... I replied in a way that was a bit tongue in cheek... and then you replied like this.
What I flat out said... was that I had been told in the past that my failed code attempts were completely visible to people. You said something indicating this might not have been an accurate statement--my reply was an attempt to confirm this... and then you went off in a random direction about how "I should have hit spoilers" that seemed to be based upon nothing I actually said.
But hey... I'm the one at fault here.
Though... that being said.. this interaction could have been more straight forward.
@TheLamia,
strlen
returns the length without the null terminator. So you need to allocatestrlen(dna) + 1
. Your solution passes after fixing that.I understand it's frustrating sometimes, but don't take that out on others. Please be respectful to other users, especially those trying to help you.
If something like this happens again and you can't figure out, consider posting your solution with a spoiler so they can help you.
We currently don't have penalties for behaviors like this, but I may ban you if you continue to act like this.
See Codewars Community Code of Conduct for our policy.
@Thelamia Feel free to let me know if I'm misunderstanding anything here.
3 and 4 are not fine.
This comment has been hidden.
The tests are working perfectly fine. Your code must be the reason of the problem.
Edit: the C version was thoroughly reviewed by a user highly experienced in C, so the chances that it's a problem with the kata are very low.
Then this means the useless error messages are where we get to have the fun times.
Which, since I am getting a total core dump--might also be a possible security issue as well. Though, one that would require a few elaborate hoops to be jumped through.
Chances are... where I am fucking up is something very easy to predict and I'll prolly feel silly... but, that just means there should be an error message for that case even more so than before.
edit: on the total core dump--I'm getting a fair amount of information about what is running, at least in where the C code is being segmented off--and the core dump is letting me know where certain libraries are located in the memory... essentially, one just has to have this type of core dump happen a certain amount of times, and make use of a format-style code injection, and... they can have access to at least a single area where the C-code is being ran.
Which is part of why whatever simple straight forward and dumb error I am doing, should prolly get a proper error message... and not this large amount of information that does me no good for solving the current problem, but can be used for a way into the Codewars' server structure.
In any case, "my solution crashes" is not an issue, and I'm sure that your code is broken. If your solution actually crashes you can't expect to receive any error message as... the program crashed.
Hello Everybody! Hello, @TheLamia! Sorry for being late!
Would like to make some notes about the test generator:
Notes on assertion:
cr_assert_fail
cr_assert_fail
is called if they are not equal! Otherwise, the memory is freed and the assertion becomes true!But I've tried to allocate using
strlen(dna)
and I suppose you've got this:If yes, then it resulted from the attempt to write the null character out of the allocated memory! Maybe it will be usefule for you Signal Code 6 Anyway I can assure that the problem is not with the test generator as it has hard limits as i did mention above... Some days ago I've thought about catching Memory Errors by User in the test cases but then what do you expect to see as a display message in such cases? and i am not sure if it is considered to be o.k.
So @TheLamia if you have some questions or suggestions about this or that case, give me a note! But i would like to ask you one thing: "Please, be a bit polite..." (flower) ;)
PureScript Translation Kumited - please accept :D
blah blah blah
im using comments for free xp
hi
Please, C Translation
TypeScript translation has been provided. Please, review and approve.
Crystal translation added.
Please add C language.
Not a suggestion.
This comment has been hidden.
The Python solution is super easy. Python, baby.
This comment has been hidden.
You don't return anything from the function.
.
Failed tests in Java have incorrect message. e.g(not accurate but you can get what I mean): expected "GCAT" but was "GCAU", while in truth it has to be reversed.
C++ translation submitted..
[Java] the name of the class should have been Bio ( not Bio() )
Same issue in javascript.
Fixed Java bug
I've made a NASM translation for this kata.
Approved.
Published a fix for a compile error in the Java version. Also added some randomized tests for good measure. If someone can approve it, then several of the open issues can be resolved.
@GiacomoSorbi, @dinglemouse, @Blind4Basics, could one of you do this? The original author is long gone. Thanks.
Typo "class Bio()" should be "class Bio"
A should convert to T and T should convert to U if its converting from DNA to RNA. Also, C converts to G while G converts to C.
Good question! DNA is double-stranded, and the template strand is converted as you described, but the coding strand corresponds to the RNA in the way the kata description explained. When DNA is sequenced, it's often that the coding strand data is shown, so the mental effort to convert those to codons and amino acids is a little bit less.
Typo "class Bio()" should be be "class Bio"
As mentioned by SeeFoEv, still a problem as of Feb 23rd 2017. Should be corrected - can confuse beginning programmers.
This comment has been hidden.
This was due to a site issue, which should be fixed now.
Javascript version of Kata could ideally have included random tests, keep that in mind when authoring future Kata :)
Thanks, good kata for strings
This comment has been hidden.
Using the third argument in replace function is non-standard and deprecated. It doesn't work in node.
See String.prototype.replace for more info.
This comment has been hidden.
You are again using the third argument. That doesn't work. The first argument is supposed to be the regex.
Also, for simple cases
RegExp("word", "g")
can be substituted by/word/g
.Wonderful, you are are truly a wizard among men! Thank you so much for all your help!
class Bio() should be class Bio instead(no parenthesis in a class declaration)
Typo: funciton --> function :)
fixed alr
Thanks for the kata! Description 3rd line contains a typo in the word function.
Haskell translation kumited.
java translation has a compile error in the class declaration it should be "public class Bio" instead of "public class Bio()"
Fixed 3 yr old Java bug
The Java translation has a compile error.
Bio() -> Bio
Sorry about that, I was typing in Python before that, you know how it is switching between languages. Secondly, I tried to make the change but i'm recieving this error -> "Description cannot be approved, recent changes from related record must be merged first."
Fixed 3 yr old Java bug
Left a Java translation if you want to take a look at it.
This comment has been hidden.
This comment has been hidden.
@Zozo thank U! ^^
Translated into Ruby, if you want to approve it; also, would you like random tests for JS and Python version too :)?
Oh, and you miss the JS sample case in the description, but don't fix it before you approve my translation (provided you want it, of course), otherwise it could give some problem with the approval process.
This is essentially a duplicate of the (already approved) kata "Complementary DNA"
I disagree, the concent is similar however my purpose is to add some bioinformatics katas. This conversion produces a biologically distinct molecule. Additionally, the complementary DNA kata is slightly incorrect in that it doesn't require the reverse complement. RNA transcription doesn't require that step. This is simpler and different in my opinion.
I think it is fine I can approve it since I'm the author of Complementary DNA
Alright, I concede! Issue removed.