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.
If we make a concatenation of string is better to declare a "std::stringstream" instead of "std::string"?!?
Why?
I'm still getting the errors on 3, 5, 6, 7.
I did a card library in unity3d in c# and I did set the seed, but that's also optional there. Is good to know anyways, now I will keep an eye when doing random tests. Is always interesting how a trivial task in one language could be a pain in the butt in other languages.
About the seed, yes, "once again", python is "battery included". Effectively there are other language (someC version I believe, I don't remember which one) where you have to generte your own seed to get the randomness. In python, the seed is "randomly" generated for you.
Note: I didn't look at your code before so when I saw mentalplex talking about assinging the seed, I thought you used a constant value. So your approach is good too, actually. But not necessary with python, so. ;)
Noted. I am not an expert on python nor random numbers and you made me look this up. Always looking to hear the more experienced coders on this site, and improve on my coding :). Apparently do you not need to set the seed, because when the random object is initialized it sets the seed to the default param which is system time.
Random Class:
Either way I am surprised the initial python kata was approved it was generating basically blank random tests with "A" and 0 for the rule. If you look at the fork diff you can spot the issue. Initial fork was generating the next random floating point number in the range [0.0, 1.0). And not a random int within a range which is what the ultimate goal was.
the seed HAS to be random. Without it, the tests are no longer random! ;)
Thanks. I guess it could be deleted. The main problem was that the random tests were blank. You can see a screenshot on the discourse kata page. I don't think the original fork knew how to generate random range. Easy fix. And not sure how many freebies went through with python.
not sure why you're setting the seed, but approved nonetheless
Fixed Random Generation code. There were issues with random numbers generation.
Added more characters, initial fork was only using a-z.
Just debugging the random generation test code, and it is not working as intended. I ran the code on my computer and even with that fixed it is making the same test over and over. Feeding letter "a" as the text and rule for 0. I believe there might be an issue with the way you are using random.
Edit 1: Here's the for loop fixed, using randint: (Note: I think this is too easy for random tests since you are only using a-z letters, you could add other characters to the chars string for more consistency with the 0-255 ASCII)