7 kyu
Simple Prime Number Generator
441Raphango
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.
This comment has been hidden.
you will not get this error now.
the error is still there
python new test framework is required. updated in this fork
Approved
I am running in a timeout when submitting my solution. I tested it for a limit of 1500 without running in a timeout. Which is the highest number use in the tests? Thx
You can just print the input: random testing reaches up to
n = 100,000
I highly suggest this kata moves from 7kyu to 5kyu or 6kyu for alignment. Many people may look for simple solutions, since it is 7kyu. I think putting it in 5 or 6 will allow people to properly gauge the work.
Agree... I think 6 kyu is fair enough... =)
Same here. I'm still slightly new to codewars, but when I see 7, I assume a one to 5 liner. This was not, hahaha. Good kata and thanks for replying! I just published my first one yesterday if you wanna check it out and give feedback.
6 lines. ;)
Generating primes is actually so (much) a common task on CW that, after a few weeks/months, you will look back at this one and gently laugh at your own comment. ;) (but well... 6 kyu wouldn't have hurt, I guess, yes. ;) )
there is a difference between a person trying to solve a 7kyu, i guess, it is not at all a 7 kyu at least needs to be 5 kyu. of course for "dan's" it might be a single line, but the complexity level should be set according to a person most likely to solve it i.e. a newbee.
This comment has been hidden.
Interesting...
I'll see if I can eventually manage to implement it.
Thanks again!
You're welcome! Copy/pasting should do the job, either that or consider asking
@anter69
;-)Too bad, I was also hoping for a kata on generator. There is actually too much kata asking for a list of prime numbers under a number n.
not really in python... (I checked)
Sorry guys for the frustration..
Well at least I made an half sieve for this one!
You'll have to learn a bit of Java: those ones are what you thought about ;)
Well I'm using Java everyday for work so I tend to use only Python when solving recreative katas on CW. However if you make a translation... :-P
if you help me with streams, I could do them and translate them... ;p (Java is a pin in the ass, for me ;/ ). I did not try those yet, because of that. Maybe you could tell me if there is a way to duplicate a stream? (that bothers me since a moment, this one)
BTW, did you try those? (I'm searching for candidates, yes! ;) )
Stream concept is that you cannot duplicate it because it computes elements on the run. Of course, you can still buffering elements in another stream elements you consume - that's how
itertools.tee
works. You should have a look at this answer quite useful.As for your katas, I will try original versions first as they are still in beta and go for yours right after!
Thx for the link.
Finally, I have the impression that those katas (about primes / at least the easier one) may do the exact same trick than the present one: use a generator, backed up by some structure. Or not... I don't know... ;)
Yeah sure. But be aware that the original of SG-1 is actually broken and undoable (unless you generate paths in the exact same way/order than the internal solution, despite what is said in the description. That's why I made mine) ;)
Or not ;-)
Have seen that, however there is also an "improved" version made by same author, testable this time!
Damn... Any leads for me? ;o
Errrr... That's mine, actually!!! ;-D
Maybe! I have to test if it is optimized enough. Will continue this discussion on the concerned kata ;)
Oopsie!
Hi!
Since the author of this kata is not gonna be around for some time (I know him personally), and only you two have solved the kata in the Python version (I think?), can you please approve the Ruby and C# translations I just wrote for the kata? :)
Kata approved! :-)
Yay!\o/
Multiple issues:
generators
, but happily except a list (see my solution)Furthermore, there are many prime based katas, but I don't complain about it being a duplicate, because none of them are so simple (in python).
But if you could really turn it into a
generator
type kata (and test the results properly), it could be more interesting.Made some changes.
Now I "suggest" using generators.
Thanks for your help!
Fixed some typos in the description, the kata should now be good to go!
Thanks again! ^^