Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
If I'm not mistaken, I think it compares the ascii or unicode number for it. '4' in ascii would be int 52 and '5' would be int 53, '6' is int 54 and so forth so anything below int 53, put a '0' and anything above put a '1'
wowza
I don´t see the ATM words in the requirements, so there could be other rules. Cheers my friend. Ending this discussion from my side.
ATM PIN codes have not meaningfully changed format since 1967. YAGNI.
Of course the Kata is not meant not change, agree on that. But training also for readable & maintable code is much better than saving 3 lines of code. If you have worked in some companies you might agree with me. The kata doesnt say anithing, but it mention "rules" and rules are likely meant to change, different from a kata that explicity say "add two numbers" and nothing else. Do you see my point? Its a programmer challenge to identify requisites that likely to change, like this. That's what I mean, not that the code is wrong.
Unless you want to maintain some dead code or another too-generic hell,
you probably don't want to anticipate that much, especially on such a simple piece of code.
That is what uses cases and product rules are for:
if a rule is meant to be changed at a later point, you simply rewrite the rule and delete the old one.
Also you can't be sure that a rule is meant to evolve - it can be discussed at some point and then it can be cancelled - or the rule is not meant to be changed at all.
The same logic applies to this kata: the description gives a simple rule, kata are not meant to be changed after leaving beta, so the rule is not likely changing at any point.
when you solve a problem you should also consider how probabl is that rules change over the time, and do your on future changes :)
its a 7 kyu challenge, wdym?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
intresting it just compiled all the 4-5 lines of code to a one liner (but, i'm being honest here it can be optimised)...
REGARDLESS, GOOD JOB
Great job, I decided as well.
Nice dude I spent so much time on this problem
Loading more items...