8 kyu
Multiply the number
9,398 of 22,540san00
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.
Hello how are you my name is Abdulhay Iam from Uzbekistan
изюминка этой задачи, вызывает улыбку
I tried doing this with the Math.Pow method, but it say that it doesn't exist in the context. I already executed the code elsewhere and it worked. Does anyone know what the problem is? I'm coding with C#
Did you add all necessary usings?
i found the problem. I was missing "using System;". I didnt think i would need it. Thanks for offering help.
This comment has been hidden.
This comment has been hidden.
Hello, I have tested my code in my editor and it passes, but when I try to run it here, I get the error 'multiply' is not defined'. Can someone help please?
We cannot tell whats wrong with your solution without seeing your solution, sorry.
Look at your function name. Is it really
multiply
?You changed the name of the solution function.
Your solution does not conform to requirements of the kata. It's not a kata issue.
that negative number in test case was tricky..finally guessed it out
mass saya pakai if(number == 10) return 50 * 5; ada yang lebih simple lagi ? btw saya baru belajar javascript
Kalau ditanya simple sih, iya simple.
Cuma, gak mungkin dong tiap angka kamu cek-cekin satu-satu terus bikin hasilnya secara manual pake if.
Soal / permasalahan ini pengennya kamu bikin fungsi yang otomatis ngambil panjang digit dan kaliin.
im going to practice C straight 10 days. today is the start.
This comment has been hidden.
You need to
using System;
.And with your latest code, you are considering the negative sign as part of the string's length, which is wrong.
Is that weird empty block in the description intentional?
fixed
This comment has been hidden.
This comment has been hidden.
Lua translation
Can someone review it ? It's my first translation. Thanks
approved
the only error is that "50 should equal 250" but that doesnt make sense. shouldnt it equal 1250?
You can use print for debugging, and I believe the test output is also showing you what the input is.
Please avoid using the
issue
tag for questions.I would argue the "should be" wording is problematic, but that's an issue with
codewars_test
, not the kata.The error message is your code returned 50 instead of 250. Neither of those is the input.
C Translation (author inactive).
makes language agnostic
approved
This comment has been hidden.
Approved
This comment has been hidden.
Agn, not a kata suggestion. Stop posting these comments at the discourse (let alone without spoiler flag
_)python new test framework is required. updated in this fork
Approved
Wrong basic test, according to it 50*5^2 is 250, correct is 1250
In the basic tests in python, there's no test that have 50 as input. Are you sure it's from basic tests?
it says so for me Time: 506ms Passed: 44Failed: 1Exit Code: 1 Test Results: Basic Tests Log 1 50 should equal 250 Log 1
The
50
there is not the input, it's your result. And the expected value is250
. You failed on input10
.Also, don't use
input
andprint
function to send the answer. The tests doesn't read answer or give input from the log / console. It directly calls your function and used argument to give the number . So it just takes what your function returned.Makes sense now, my bad and thanks.
Well, at least for JS there is no debugging. Just a simple-dimple code writing. Nevertheless, funny enough
This comment has been hidden.
Description should be language-agnostic
done
Silly!!
Ruby 3.0 should be enabled.
done
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
I've added extra details in the example to make things clear. Also, the description stated "multiply each number", not "each digit", so I guess what the author intended is for us to multiply the whole number.
This comment has been hidden.
Missing a using statement.
Jack sounds like somebody who has bodies burried in his basement...
Excellent, I liked the idea to take the case of negative numbers.
C# translation, please review and approve.
'alr approved some time ago'
Thanks!
No probs, glad you like it.
python test cases broken
File "", line 8 Test.describe("Basic Tests") ^ SyntaxError: invalid syntax
Hi, thanks for the feedback. I didn't write the python version but I'll try to get it resolved.
Found out resolve for issue, but don't have explanation for that. =) My bad; all working well and issue closed.
Cool kata
Thanks and glad it's sorted :)
CoffeeScript translation Kumited! Please accept :D
'alr approved some time ago'
Hi there, I'm a total newbie, so kata like this are perfect for just getting started. Thank you! It seemed easy for the first 4 test cases, but then I had to go away and learn something new (for me) to pass the 5th test case. Thanks!
How does one do the negative numbers test?
Java translation kumited.
+1
I think you can never have too many katas, and beginners need katas like these, which they won't necessarily find easy.
Worrying about issues caused by there being too many katas is worrying about problems that don't exist. If a beginner wants to spend 30 hours of their life doing 300 katas like this one just for a hollow level 5, they're only cheating themselves out of progress.
As long as we each know how much we've worked to achieve our own scores, we shouldn't worry too much about how others achieved theirs and just be proud of ourselves for getting to the level we're at.
Is that a kata?-)
For a beginner I would say it qualifies and it is not too different from few other very basic math kata.
You can have thousand of katas like that one, multiply by six, by seven and so on:-) Nevertheless I approved it by fear it got a 4 kyu:-)
Just a little bit smiling;-)... Translations for this "k..."? But here 8kyu is ok, bacause 10 is not available... Sorry, but these kinds of katas are only good for collecting some points, all the "beginners" will smile too;-).
It is our day... As always you are a wise man:-)
But you too, great idea to prevent 4kyu (my finger was on the 4kyu button:-)) - many thanks! Yes... it's our day;-)
That's one problem here, there's no lower limit for the quality of katas... So i can publish 100 of these "katas", get 300 beta points and maybe 2000 of users who solve them... The good ones aren't solved and if there are less points... So generally the quality reduces... PS: one reason for me to stop or reduce publishing
Funny, as opinions might diverge, as I used to think that what makes CW great is the great, supportive community which usually helps a lot in ranking or improving katas, instead of wasting everybody's time on snarky remarks.
Anyway, the not-too-supported beginner author contacted me in private demanding me to beef up the kata a bit, so I hope now it is more palatable even for the more demanding coders.
P.S.: again my shortcoming, I would assume, but I also miss the ratio according to which one should stop/reduce publishing katas here, as the reason above would instead motivate me to write even better content and help other improving their kata creation skills.
I think here's not the right place to discuss this... Perhaps to give only some points after beta process could be a solution too and only if average ranking is greater than 7kyu... So it's a surprise if you get these points. But perhaps we stop here, generally it works as it is, not always fair, but it works (and sometimes rebells like me, think about it:-))...
Wasting time with snarky remarks? I don't think that this were snarky remarks. And one motivation for publishing katas is to look into the different solutions and to get new ideas for coding. So if nobody solves the really interesing but harder katas (because of endless very simple ones), it's not worth to create and publish them... So there are always different sides. To discuss such opinions perhaps is part of a community too, so not only coding and not looking from left to right;-)... But as always only my personal opinion - so perhaps for today it's enough;-)...
Again I fail to see where a beginner here would get new idea for coding, but ok, it must be just me again.
Also, I can't really, see how having easier kata would distract people from completing harder ones: according to how much time and cognitive energies I have, I look for differently ranked kata with our internal search and I know many people doing the same, so when we are so hungry that we want to savour a 4+kyu kata, we just look for that.
Harder kata on average get less activity because... well, are just harder. To prove this, also consider that the initial CW had much easier katas, yet it evolved gradually having higher standards despite a HUGE load of very easy katas, so...
Perhaps it's a endless discussion, you will get points for both sides. So as i wrote before perhaps we stop it, it works as it is, sometimes fair and good and sometimes not. I can't really disagree to you or your last points and it's not my intension. But for some things my opinion differs. It's always difficult to bring different users on difficult levels together, so there surely exists no perfect solution.
Just a quick note, including also (if not mostly) myself: being top-rankers (among the first 100 in the leaderboard, for what that matters), let's try to be both as supportive as possible and mindful of how people see and weigh our opinions.
I think in this case it could have been better to open an issue and demand for some extra challenge or other edits in the kata (I still think that this one is on par with others for complete beginners, but ok, that's just my highly debatable PoV), possibly also suggesting what/how to do. But the fact is that sometimes a beginner can be easily disheartened and I would like to avoid here to get "stackoverflow effect", if you get what I mean. That's it.
Oh, and it was a pleasure exchanging opinions and dealing with different perspectives :)
No problem and for me everything is ok. I don't expect to change these things here, normally it works (but i wrote it before). If it's necessary to praise a kata like "return number*5", which was the beginning of our discussion, for me it was a little bit strange and one step gave the next. Generally it's always worth to discuss what could be done better and so sometimes discussions get a little bit harder;-)... But i think this should be no problem if later on all "come together again". So it really was a pleasure and no waste of time:-)...
Oh, if that's the point, a quick note about how I see things differently, as there is at least an element you might not know: both the "praiser" (which actually praised the effort, more than the kata) and the author are two people I train (big word, I know).
The praiser in particular helped in person the author to fix a few things and create the tests. I know because we were all here; the author is working hard on improving her JS skills, exercising each day after work, so I think a praise on the effort was not that much out of place.
And this part of the discussion is certainly stimulating and worth thousands of words :)
This was the starting point;-) So i think some points were really a critic on the point- system here on codewars and perhaps sometimes the way to get and climb a position in this "leader- list". To find a "perfect solution" for these "problems" is difficult (if exists), so it's always easy to criticize... i know this;-). Often it's difficult to understand different opinions here, because some are very short and every user has a different background or motivation (sometimes language problems too) we don't know and recognize. So i think we don't differ too much and it's interesting to know a little bit more of perhaps some other activities around (for me this point is also "a little bit difficult" here, because codewars contains no "chat- system" and is often strictly reduced to solve katas or to produce code;-)). So i only can say, keep on your surely good work, and don't be annoyed too much - take me by name "smile67" and look for my hints: >= ";-) & :-)"...
Translated into both Python and Ruby, if you want to approve them and nice first kata, brava :)
This is marked with the "Bugs" tag but there's no real bugs to fix here. you create the whole code yourself short of the function name and parameter.
perhaps stick something in there like:
so that theyre actually fixing something 1) * instead of x b) return needs to be within function c) instead of defining "var a" and returning that can just submit "return num * 5" and d) remove "=" from first line.
removed
bugs
tag, changed categoryBug Fixes
-->Fundamentals
Good effort for your first kata:D
Can't share this (or is it a joke;-)?)... i think a little, little, little bit work and/or a simple but perhaps good idea is no mistake... for the first kata too. But it's only my personal opinion...;-)