7 kyu
Find the random seed
332jamad
Loading description...
Fundamentals
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.
Haskell translation
I've modified the description to make it more language agnostic and to address this issue
This comment has been hidden.
Fixed, also found an off by one in the tests.
python new test framework is required. updated in this fork
Approved for framework update
Thanks. Updated in This list
Nice idea but the description is lacking import informations :
random
library.This should have been an
Issue
. The kata is not solvable without these specifications.This comment has been hidden.
This comment has been hidden.
added some explanation as spoiler
Same issues mentioned before: (1). py2 cannot pass. (2). 0<=x<100 should be 0<=x<=100.
I have just fixed the issues. Thanks for your report. (1) py2 should pass its sample test as well as py3 (2) '0<=x<=100' is used in the description.
This comment has been hidden.
Sample tests only works for Python 3 while the real tests works fine for both Python 2 and 3. I suppose the RNG implementation was changed between the two versions.
Whoever approved the kata: Please provide both sets of tests for Python 2 and 3, and then use some standard techniques to run the relevant portion of sample tests for different Python versions.
As an original kata author, I appologize that I did not take care of Python2 version very well enough then. Actually I did not know I had to check both 2 and 3 so will take care of them after this. Thanks for your input @Voile and sorry for your dissapointment @keepclean.
The sample test cases were updated so that python 2 should work fine.
There is no way to get back the seed itself. The seed is used to update the internal state of the random number generator, and it is not directly stored anywhere.
Not an issue.
If you don't know how to solve a kata,
try harder
;-)This article can be useful for you ;-)
This comment has been hidden.
This comment has been hidden.
Updated description, added example tests and approved the kata
Cheers
Great.Thanks a lot for approving it. I also appreciate others who corrected my bad description and code. :)
Maybe you have some mistake. random.randint[a, b], including both end points. In the kase of random.randint(1,100), even with the same seed, there are different sequence.
Thank you for your input @sogr. I checked your solution and it looks different from others. I did not know the way you did could match the expected result. So it is a good learning to me. You can see solution from the others because you have already solved it.
Your are not a friend of
< or <=
? Looks like "0<=n<10000" and range "0...100". So wrong description or code;-)...Thank you for your input. Indeed, it was my bad to have the mismatch after changing some premise. By some reasons, my republishment with correction fails by the following error, though validations I tried were passed.
Though I cannot update my own solution code to republish, the change for its description was fine so it was updated. But won't mark it resolved until I update my code.
I fixed the description for you (
between 0 and 100
and0 < n < 10000
).Why only this point? The description shows an example for n=0, but n=0 is not part of the solutions...;-)
Thank you @siebenschlaefer for edit but it was my original description that I changed after the input from @smile67. More specifically, 0<n<10000 was my description then I updated it 0<=n<10000 as example was for 0 , then you reverted it to 0<n<10000 again. :) So, the issue is still valid though it was marked as resolved. I could not update the code by unknown reason as I wrote previously.
To keep it short... fixed it;-)
Oh, I have updated the example. Could you check if it did not break your fix, @smile67? Thanks.
Thougt you are not able to fix it;-)... But generally it's ok now (both changes), only for n=0 it isn't tested... all solutions are still vaild too
Thanks a lot for your check, @smile67. Correct. All I can edit is only for description while I cannot change my code strangely.