7 kyu
See You Next Happy Year
387 of 7,074MrZizoScream
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.
Please fix the test!
if you want something to be fixed then demonstrate how it is broken such that another person can reproduce the situation. otherwise nobody has any clue what you're referring to (and most people will probably assume there's nothing wrong and that you're simply dealing with a bug in your own code)
Duplicate of Simple Fun #144: Distinct Digit Year
Help please, I really don’t understand what’s going on. My code passes the test for large values, but not for basic and random values.
ok, I looked at the author's examples, and this is REALLY a complaint. In his opinion, if a function is given 1987, it should return 2013, but why if 1987 is already a lucky number? And the question to the author is why 5680 is correct and not 5679. Both are happy years, but 5679 is closer. So why did the author think that 5680 is correct and not 5679?
Expected: equal to 2013 Actual: 1987
Expected: equal to 5680 Actual: 5679
It does say: See you next happy year. So, current year doesn't count. About the other case, you don't mention the input value, so, if the input was 5679, then, the next happy year is 5680.
Testing for 1706 It should work for random inputs too - Expected: 1708, instead got: 1706
Random tests are failing, please look into the issue
No, your solution is failing - not kata issue.
Actual and expected are swapped in C#
Tests mess what was Expected and what was passed and does not accept 1987 and 7968 as "happy years"
Please:
D translation
Approved
C# Function name should use
PascalCase
Fork with name correction (solutions using previous name will not be invalidated). Please doulble-check fork for functionality, thanks.
Thanks for the fix
Actual and expected are flipped in Attempt tests.
R translation (author inactive)
Approved
Ruby 3.0 should be enabled.
Description should be properly formatted.
Ruby 3.0 enabled in this fork
I dont know anything anymore. How do you even type emojis in this site.
static
beforepublic
is making my eye twitch, but good kata regardless!nice one!
The saga of prolog translations continues ;-)
Revised and APPROVED , Thanks bro and See you Next Happy Year :smile:
Check_Basic_Values expected:<2013> but was:<1987>
I keep getting the error above for my code, however I have tried my code on other platforms where it worked perfectly. My code only increments the year, thus it shouldn't be possible to get that "was" year. I would be glad if I could get some feedback on my code and/or this issue.
@khazned
This comment has been hidden.
Rust translation kumited :-)
Revised and Approved :+1:
This comment has been hidden.
Not a kata issue. This should have been a
Question
. Closing.I could tell you where the error is, but I won't. Your program incorrectly implements the spec.
Closure Translation ready for review.
'alr approved by someone'
liked <3!. "a distinct comment"
Please correct details or tests in java lang. Input Year with in range (1000 ≤ y ≤ 9000); test: assertEquals(9012, HappyYear.nextHappyYear(8999));
@vztot
Yep ma bad. sry
In CFML, the Tests failed even though the Attempts pass. There seems to be an issue with truncating the expectations on these CFML tests.
@shawnoden
Thank you for the quick attention. Tested my original solution, and it passes both Test and Attempt.
About the CFML translation. The description states: Input Year with in range (1000 ≤ y ≤ 9000)
However there are three test cases that test for 100, 200 and 333 and expect 1023, 2013 and 3401
@Rickman9
CFML Translation!
Actual and expected are flipped in C# assertions.
BasicValues Test Failed Expected: 1987 But was: 2013
Above How can I know what value was passed? Im new so Im not familiar with what is happening. Thanks in advance.
System.Console.WriteLine(year);
Actual and expected are flipped in C# assertions.
Fixed
just add year + 1 at the beginning to make sure it's at least 1 year after
Elixir translation
ReasonML translation
.
Julia translation :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee: :coffee:
CoffeeScript translation :coffee: (btw, coffee emoji code is
:coffee:
)TypeScript translation
Revised and APPROVED :+1:
Dart translation kumited
APPROVED :+1:
PHP translation kumited!
@Steffan153 .. Thanks Caleb , Revised and Approved :+1:
Haskell : https://www.codewars.com/kumite/5bdfa9c5660c2cb6c0000084?sel=5bdfa9c5660c2cb6c0000084
@cliffstamp .. Revised and Approved :+1:
Zero is in the input......
@sunnike ..
Fixed.
Getting a 0 as Input
@danderle ..
Its in C
@danderle ..
Fixed.
This comment has been hidden.
@daniels4 ..
@daniels4 ..
Fixed.
expected 7961 but was 7960 both are distinct numbers??
@sahil9420 ..
what do you mean writing in description about only distinct digits? maybe any hint??
@yellowBunny ..
thanks for answer :)
@MrZizoScream - you should explain it better in the description
In the first Javascript test, there is given 1001 and the expected output is 1023. Can't it be 1002 for example ( which is a distinct number as well ). Please tell me if i am not right.
Thank you.
@vint55 ...
@MrZizoScream, Java xlation ready.
@clcraig ..
C and C# translation Kumited.
@holysloth .. as I Promised Bro :relaxed: :relaxed: Double Instant Approvals :blush: :blush: , awaiting for more and more :wink: :wink: .. Regards .. Zizou
Fortran Translation Kumited - please accept :D
Why? Why don't you add translation for my kata? crying in my bathroom :(
Be patient, a translation is coming your way ... ;)
@donaldsebleung ..
Oh, this: https://www.codewars.com/kata/simple-fun-number-144-distinct-digit-year
So, It's a duplicate o_O
Thanks for the link ;)
And it was approved anyway. No use keeping this issue open then. Also, this has collected translations the other one has not.
It's kinda sad that the duplicate is more popular than the original one.
Why do you use
short
?@Unnamed .. Well ..
Unsigned
is for Only Positive Number , Since year is within the range 1000 <= year <= 9000 :point_up: :point_up:Short
because its will not exceed 65536 Which is the Maximum numberShort
can accomodate , more memory-friendly , and less consumption :wink: :wink: :wink:People always argue about using
unsigned
, I'm OK with either choice. Usingshort
doesn't really give any advantage in a case like this; there're no arrays, CPUs are 64-bit or 32-bit anyway, (and on 16-bit platformsint
would most likely be 16-bit too). I hadn't voted here. However, it happens with many katas that I'm "kind of satisfied". It's when they're not duplicates, are relatively well done, but have no really original concepts, they feel like something between "very" and "somewhat" "satisfied", so I may choose either without too obvious reasons (although I try not voting "somewhat" too much at least for beta katas).Well, that goes for like most of the white/yellow katas.
I don't see why
unsigned short int
is used instead of justint
either, is it a new fad like Fortnite or something?bro Fortnite is sick
Python, Ruby, Crystal and JavaScript versions kumited :+1:
@GiacomoSorbi ... Maaaaaan , Of Course Approved :relaxed: :relaxed: .. many many Thanks Giacomo .. regards .. Zizou