7 kyu
Circular Primes
391 of 433Nmistrata
Loading description...
Algorithms
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.
Ruby 3.0 should be enabled, see this to learn how to do it
Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)
fixed
Java translation submitted
Anyone?
179 should become True but it failed in random test.
179 is not a circular prime:
Thanks @atner69. Yes, you are right. The problem is I passed the kata by the imcomplete logic, then. It could be a part of the fixed test cases. >> Added the case for 179 in both test cases.
Ruby translation kumited! Please review and approve :-)
Anybody to approve this translation?
Any love for this translation?
done
Thanks
...tests for numbers up to 10000.
=>
test.assert_equals(circular_prime(11939), True)
??Sure, it's not in the random tests, though... Seems inconsistent. ;)
Deal with it! B-)
You don't understand what I mean...
Fixed
cool, thx :)
This comment has been hidden.
There is not much you can do against such solutions, if the possible results are of a limited set.
My "favourite" so far was this kata: elaborate description, 6 kyu, etc, but the solution is... well, rather similar :-)
edit: updated description with the test range
This comment has been hidden.
Approved.
There is still a problem, as it is expecting to return
True
for inputs like 20 or 50...Fixed the tests and updated the description a bit.
There is a big problem with the prime checker in the random tests : (
It returns
True
for 1, any square of a prime and any number that it's factors are two consecutive primes where the lower one is equal to the integer part of the number's square root eg.5 * 7 = 35, sqrt(35) = 5.916079..., 5 = floor(sqrt(35))
,This means that the random tests expect 1, 4, 6, 9, 35 and 53 to be circular primes when (with the exception of 53) thay aren't even prime!
Agree, might I suggest a more accurate testing function?
This comment has been hidden.
marking as resolved