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.
Not an issue
OMG, I've found that I have not read description to the end.
Dividing numbers is taught at primary school. The only harder thing is detecting the case when there's no "cycle" but it's written in the description.
OK, maybe not at primary school when it comes to decimal fractions, but still at school.
I really liked this kata, because it shows how important is to use as many instruction as you can.
Thanks!
Maybe this part of the description is not clear enough:
In other words I wanted to say that the cycles have no interest for the kata if n and 10 are coprimes (Cycles must begin just after the decimal dot). Would it be better to modify the description?
5 doesn't divide 12 and 22.
1/22 has a 2-long cycle beginning at second decimal.
1/12 has a 1-long cycle beginning at third decimal.
1/12 and 1/22 are not terminating decimals - they can't be written as 1/ (2^m 5^n). They do have a cycle.
12 and 22 have 2 as common divisor.
;-)
This comment is hidden because it contains spoiler information about the solution
oscar, what you've written is a floating point approximation to 1/69, which is not the decimal expansion of 1/69. This approach can only show cycles of length smaller that size of float.
I get ""0144927536231884059730878888672123139258474111557006835937500000000000" result for 1/69 and I can't see cycle length 22, whats wrong?.
I get it, then the master should say that you can not use eval string, for example you can use array :(. make it simple as much as you can.
Thank you for you intelligent answer.
Hey body, you should do more than
eval string
for 4kyu kata level, what do you think? Lol))I am getting this error using Ruby:
evaluate': undefined method
eval' for #Calculator:0x0000e32b8aaed0 (NoMethodError)from
block in <main>' from
each'from `'
Does not this kata work anymore?
Loading more items...