8 kyu
You Can't Code Under Pressure #1
82,295 of 243,559Kerrick
Loading description...
Fundamentals
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.
This comment has been hidden.
Please stop posting solutions.
you got me, no joke
LMAOO i thought i had to convert to a number of type double
Hi there! I am now at this platfrom currently having an issue can anyone help! I couldn't understand after pressing the test it's showing the test passed, on the otherhand after pressing the attempt it's showing errors can't understand how to use this platfrom. Can any one help!
your code is incorrect, even if it passes some tests.
when it fails a test, you see this:
where your code returned
16
, whereas it should have returned8
Why is there the key word 'pass'?
I'm under pressure
Way too easy, took only a second, if even.
This kata made me feel like a world-class hacker.
super simple
This comment has been hidden.
You're not doubling it, you're squaring it instead. Not a kata issue.
I see. Sometimes the mind is too clogged to notice the simplist of things. lol
Super easy and literal!
This comment has been hidden.
A Piece of Cake!
C:
fork fixing those
Approved
Nice and simple but it has the potential to draw attention to some features of the language you're using. Thanks for the level up!
please help when I test my solution it shows 'Pass' but when it attempt it shows 'Failed'. What I am doing wrong?
Maybe you guys misunderstood the task. Check the meaning of "double".
You are squaring the input, not doubling it. The unique sample test passes because
2 x 2
=2²
good one :)
that was ez
I just figured out that!
Under the Pressure I even saw
pass
asreturn
. :)Tests are returning success where as Attempts are returning failures with very odd test cases
Your code is wrong and it doesn't do what is asked. The tests are fine.
Thank you, I thought double meant 8^2: I know I'm absolutely retarded, but programming is my last shot at life before I off myself
Don't be so hard on yourself, anyone can make mistakes.
it's too hard lol
Dart translation
.
And the upgrade to the latest version 2.14, because for some reason the version of published translation is 2.8 =/
Oh sorry about that, I messed up. Question: is it necessary to fork the kata? I picked the wrong version for some of my kata too, so I'd like to know if I can just pick the version or if I have to fork
My tests all pass but when I press attempt, it says they failed.
You passed the kata, no idea what you were doing wrong. Please read this: https://docs.codewars.com/training/troubleshooting
kata too difficult, should be 1 kyu
I guess we can code under pressure
I think this kata is way too simple.
The Factor example test doesn't work... it seems to be an unedited placeholder.
Fixed by gifti
It's not completing for some reason. It appears under 'Kata I have not completed' even everything was submitted succesfully.
I see it listed in your completed list.
Yeah that's weird it could be a codewars bug.
32 seconds lol
Had to brainstorm the solution, good one!
I think this is my favorite kata. I thought it was a prank.
This was the best kata!
This comment has been hidden.
One of the tests is telling me "expected 16 to equal 8"
And one of the random ones is showing a negative as answer
Is this normal behavior?
You're squareing it, not doubling it.
This comment has been hidden.
Not a kata issue, that's your code's problem. See other solutions.
This comment has been hidden.
My solution passes and it hasn't assignment.
my head hurts :(
Finaly i can take place in google team)))
Python sample tests don't need the backwards compatibility import check, they aren't run against old solutions.
Resolved
Extreme!
I need vacation now
Whew
I'm a damn genius
Can someone help me on the doubled integer
Hi. You misunderstood the task. See there: https://dictionary.cambridge.org/dictionary/english/double
i keep attempting and testing and I'm sure that I was right and yest the sample tests aren't working
You need to "return" the answer not print it.
i'm in to angular for the past 5 months. and this is the first time i'm seeing typescripts procedural coding way. It's just great learning a lot thank you codingwars for teaching me the fundamentals.
too simple lmao
New kyu 9 confirmed!!
This comment has been hidden.
s **= 2
would make it square. You probably means *= 2
Lua translation ready for review :)
(in python) I don't think the return i*2 solution should work because that will not change the permanent value of i for exponential increments like I think it was pretended in the instructions... Maybe I'm wrong because I'm new. If I am I'm sorry
I mean the point isn't to change i, its to create a function that returns double the value of i. Whether you're changing i itself or just returning i * 2, its the same thing.
OCaml translation.
Please review and approve, thanks !
Approved by someone.
Thanks to the someone.
Free honor lol
This comment has been hidden.
How would this be a kata issue (= a bug)?
This comment has been hidden.
you need to return the answer within the function, not just print the answer
also, you are not supposed to call the function yourself. codewars tests will automatically call it for you
PS, add a spoiler flag the next time you post code (i have added it for you)
this is a fun kata
Could someone please help me with this one?
Try this other kata first: https://www.codewars.com/kata/50654ddff44f800200000004/shell
what language did you use?
Fun one :)
A year ago and I still don't get the joke
COBOL translation updated (author gone).
Approved
a real simple solution, but every time panick me -:)
Absolute palm-sweating experience, almost had a panick attack while using the fullest of my brain power to find the solution.
Typescript translation (author inactive)
Thanks :)
This comment has been hidden.
This comment has been hidden.
The input argument is in
edi
. The System V AMD64 ABI calling convention should be used to solve Codewars NASM kata.You can also look at the table in this video (4")
Very Easy to do
yes very easy exept IF U ARE A JUNIOR IN PROGRAD JUNIOR THAT BARLY DOES IT
F# Translation
this translation is gone (no idea what happened to it, it is empty and cannot be approved nor rejected); but another F# translation was approved
Julia translation
Factor sample tests error (submit works):
Log /workspace/example/tests/tests.factor
4: USING: example tools.testest ; ^ Vocabulary does not exist name "example" (U) Quotation: [ c-to-factor => ] Word: c-to-factor (U) Quotation: [ [ (get-catchstack) push ] dip call => (get-catchstack) pop* ] (O) Word: command-line-startup (O) Word: run (O) Word: load-vocab (O) Method: M\ vocab (require) (O) Word: load-source (O) Word: parse-file (O) Word: parse-stream (O) Word: parse-fresh (O) Word: (parse-lines) (O) Word: (parse-until) (O) Word: parse-until-step (O) Word: execute-parsing (O) Word: POSTPONE: USING: (O) Word: use-vocab (O) Word: load-vocab (O) Word: no-vocab (O) Method: M\ object throw (U) Quotation: [ OBJ-CURRENT-THREAD special-object error-thread set-global current-continuation => error-continuation set-global [ original-error set-global ] [ rethrow ] bi ]
This comment has been hidden.
w
Crystal translation (author inactive)
Factor sample code is not working
This comment has been hidden.
Factor as in the Factor language. The code you shows seems like Python.
Fixed
What is the interest of this kata ?
a simple solution is also difficult for someone
Some translations:
(Author is inactive)
Easy task
100 kyu
thanks for the free points lol
BF translation available.
Prolog translation available. (author is inactive)
This comment has been hidden.
It's 8 kyu, it's supposed to be easy.
I would suggest giving an appropriate class name, for example - class CodeUnderPressure1
resolving (seehere)
I did not really understand this lesson. If you are under pressure you cant do the simplest calculations?
No random tests in :
Looks like they were added for JavaScript, but still missing for CoffeeScript and Java.
coffeescript added
Added to java, closing ~~
Ruby and Python updated translations with random tests and function named to
double_integer
(keeping existing solutions valid)Nice fix.
Thank you
This comment has been hidden.
Forked Ruby again ;)
PHP translation, please check and approve :-)
Done.
Thank you :-) I've also update Ruby and Python translations :-)
Hi everybody I'm new in Java and I tried to convert the Integer to double and to return it. This is what I wrote
public class Java { public static double doubleInteger(int i) { // Double the integer and return it! double y= (double) i;
}
Can sombody tell me what is the problem with this code please
That's not what you have to do, you have to return the double of the input value (not change the data type). Check the sample test.
Okay thanks
That feel when you fall for the pressure and multiply the integer instead of adding it.
Actually, since we are working in binary numbers *2 is faster
Python and Ruby function's name should be
double_integer
notdoubleInteger
. If anybody changes it, try to keep the current solutions working.All done and update, please see my comment at the top :-)
Run sample tests wouldn't work. So I unlocked the solutions for no reason. Please provide a test case for the Python 'sample tests'.
Done.
Very good for newbies training!
Lame kata after already solving https://www.codewars.com/kata/beginner-lost-without-a-map
Just because its easy for you, doesn't mean that other people will find it easy.
My point is if a kata builds upon (the knowledge gained of) another kata, that the latter one should be offered first by codewars. Or get some notification about it.
The katas don't directly build on another kata. The algorithm to provide the katas doesn't know how hard one kata is to another, it only knows what rank it is.
that's why i'm reporting an issue
I see you consider a lot of katas lame, why don't you write some yourself then? A lot of katas are similar without being an exact duplicate. They have different authors too, and no, the kata authors don't need to add a notification if some other kata is harder than their own (why should them?). I see you've mostly solved 8 kyu katas (the easiest ones) try some harder katas and see if you can solve them.
Don't report an issue when there's no need to. You've been commenting on about half of the 8kyu katas, saying how they are all duplicates. You can't do anything to change that now, as they were made like 3 years ago. Try doing what Chrono says and do some harder katas, like 3 - 4kyu, instead of complaining how easy 8kyu katas are.
Another thing, in the home below the language select, you can choose how the system suggest the next kata to solve, try changing it to rank up instead of fundamentals or whatever option you find suitable to you.
I'll admit, I was making all kinds of stupid mistakes at the prompting of the title.
A great sociology experiment.
Needs random tests
By the way, when I first read the instructions, I actually hesitated for a second! :p
Some of the have them, without explicit details (language in this case), these issues will remain unresolved.
Test cases are missing for Python
It's not a good thing but not a big deal. It's a elementary 8kyu after all ;-)
This comment has been hidden.
Looks like it's your own code problem.
hello follow on google+ carlos turcios #starwars
This comment has been hidden.
This kata should provide at least one predefined user test case, so "Run test" won't exit with an error message...
Well, it's certainly not a good practice, but for such a 8kyu you can always just run it against the actual tests.
Probably just me being a retard, but I thought the task was asking me to convert the integer to a double and return it. Am not a clever man. >_>
Had the same issue
<<<LOL>>>
This comment has been hidden.
Not in spec
Made a Java translation; 7 languages on the way!
in the Haskell version, the type should be Integer -> Integer, not a -> a. in Haskell It's impossible to have a doubling function of the type a -> a.
Fixed.
I just got this error
Could somebody help me?
yes,i get it too.
There was a bug in the initial solution, I have fixed it.
This comment has been hidden.
There was a bug in the initial solution...
This comment has been hidden.
The initial Haskell solution has a few problems: wrong module name (
Kth
instead ofKata
), missingwhere
keyword and a sig fordoubleInteger
instead ofdoubleinteger
.Fixed. I changed the name from
Kata
toDoubleInteger
.In general, I'd like to see codewars move towards supporting refering to old kata as libraries, so for Haskell/Clojure/Julia/Scala/Java/Erlang/C++ this will mean declaring your modules/namespaces/classes with meaningful names.
Thanks for vetting this, BTW.
Cool, that should open up some interesting possibilities :)
I think the
where
keyword should still be added asdoesn't compile but
does.
Done.
Thanks.
Furthermore, the provided function signature is just a -> a, whereas the Kata says that it should double a number, so the function should AT LEAST be Num a => a -> a
Fixed.
Allright, I've done a CLojure and (finally!) a Haskell translation! This'll be the second kata to have all 6 languages supported!
Hope its okay, I added some randomized testing to your haskell solution...
Only the better!
This is my first kata that I atcutally completed here without cheating!! I finished the codecademy thing and was told to come here, all the other ones are pretty foregin to me but this is a great start!!! So excited!! Thanks!
I too came here fresh out of codeacademy. Good luck :)
I'm a bit confused what you're trying to do with this kata.
I think there used to be a "time taken to complete" type stat somewhere. Can't see it now, though.