6 kyu
A + B == 123
730 of 1,051dinglemouse
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.
the C translation has
which looks awkward, as the cast has no effect here. the operator precedence is
( (int)a ) + b
, not(int) (A + B)
as stated in the description, anda
is already anint
, so it's casting anint
to anint
.Updated
the cast is still useless, as
sum
is already anint
:(unlike Java/C#, C freely allows the mix of different integer types. the cast appeared in the translation to follow the description and replicate other languages' test code, but it looks misguided in C.
My bad. I changed without thinking. Fixed again.
Improve the description to avoid being too abstract. According to your description just returning 123 should be correct in every case regardless of the input integer.
This comment has been hidden.
Consider numeric overflows
what's the trick? please, explain
Consider the value of an integer larger than the language maximum for an integer...
lOl tHe fUnNiEsT kAtA eVeR.
C Translation
Approved. Thanks.
C# Translation
Approved. Thanks!
Groovy initial solution setup is missing
static
modifier onint123
method.Fixed.
LOL That was funny.
Hahaha, that was dirty. I am amused.
I think mathematicians will go mad if they saw that
Kotlin translation
Just to join the fun :D
Approved!
:-)
if you need help you should know numbers become negative when they're too big :)
please don't publicise spoilers
fine
this isn't kata, this is you bullying noobs. give one more hint
No a suggestion
Need some help - What is the kata asking? If a+b is 123, and a is 500, then how can b not be negative?
Perhaps you need to review some basic language features and basic CS101 concepts ;-)
Also, if you're completely stuck with a kata, then perhaps giving up is also a good choice ;-)
I will never give up
This comment has been hidden.
I can't prevent noobs making completely ridiculous voting choices (see solution page for big doses of this). And given that most CW visitors are noobs, it's bound to happen anyway.
But they give me motivation to make more purple katas these noobs can't solve. FeelsGoodMan?
Nah, they can always cheat :trollface:
Voile is mad ppl dont like him
Need some help - What is the kata asking? If
a+b
is123
, anda
is500
, then how canb
not be negative?This comment has been hidden.
.
@Blind4Basics that was a great tip, thanks
am I supposed to figure something out? or can I not solve it because no one has ever taught me the trick?
You will either immediately recognise what this Kata is all about, or you will have no idea.
If you have no idea, just give up and try another Kata.
If you immediately recognise what this Kata is about, what's the point of completing it? And if everyone who has no idea should just give up and move on, who is it for?
Groovy translation up! https://www.codewars.com/kumite/5a8e0588373c2edf1100004b
please review/accept.
Approved. Thanks!
This is what I get for Java 1.08. Stuck. But works on my IDE
/home/codewarrior/src/main/java/Dinglemouse.java:9: error: reached end of file while parsing } ^ 1 error
FAILURE: Build failed with an exception.
It's a problem of copy/paste of your code: you forgot to select the last
}
of the existing code on CW before pasting, I'll bet, since the kata works fine on my side. ;)Approved.
You rank high, compared to "some" ;) I don't know who ranked it as 5 kyu... (Is that you? :o ) It's 7, not 6 and never 5 kyu. ;)
IMO, I mean. ;) (and DM won't disagree, I believe)
EDIT: (well, might be "7-0.5" kyu, yeah... anyway...)
@ice1000. Thanks for approving!
re Kata rank: I just write them and the community decides it. Sometimes I am surprised in both directions, but I don't lay awake at night wondering why a 6 was not a 7 or vice versa. It all evens out in the end. It's all good.
It's not me.
I consider it a 6.1 kyu so I gave 6
Maybe someone ranked it as 4 or 5 kyu so I saw the average level is 5 kyu.
Anyway thanks for your suggestion.
since you approved it could you tell me something that will help me here
No sorry. It become less fun when I tell you the truth ;-)
Great kata :) thank you
Cheers. I might write some more little ones like this... keep watching.
This comment has been hidden.
Got it. Thx.
Funny one! ;)
(btw, did you see the last kata I published? (I suppose that you're the one who stared it, right?) I'll also release in the next few days the java translation of my other one, if you might be interested into that too).
Cheers!
Sure, I saw it and starred it... but my solution for the original SG1 no longer worked for some subtle reason (diagonal path considered longer than straight path even though same number of steps?) so I don't know if I can be bothered to revist all that maze code just yet!
Yes, that's the thing about it and that's the same in my version (but this time, it's "clearly explained" (I guess?). Meaning, about the diagonal thing). The original author added this feature after you completed it.
I hope you'll like it (even if the requierment about diagonals seems quite strange, yes. But that's not without meaning in a "real life approach", actually). Be aware that you'll encounter one disgusting edge case (that took me a while to find a way to circumvent it, but that what gives its interest to this kata!).
;)
Where is the
JS
version? :Pit's waiting on you to be created... ;)
(btw, you code in Java and python too, don't you? they are your nth... languages?)
Yes :D
But generally, coding in JS is much faster and easier, so I prefer coding in JS :P
Faster than python? Damn... :o In what, please? Because your used to it or is there anything else?
(maybe one day, JS will be mine... ;) )
Probably the former, but also because python is very sensitive to code structure (just imagine all the
if
s!).