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.
This comment is hidden because it contains spoiler information about the solution
My preference is some biased and ( always ) some unbiased. With biased values, there's always the possibility you miss something in the biasing.
Yes, this depends on people reporting edge cases for their particular solution that come out of any random test. Not everybody will, but people have been known to do that.
My way in Haskell ( includes shrinking; the built-ins now just work ).
I think perhaps we could generate 100 random tests the current way, and 100 your way.
Would random generation be better if we didn't generate fully random numbers and random powers of 2, but random
m,n
s forx = 2^m * (2n + 1)
, maybe with a higher probability ofn = 0
? I think that would distribute generated values more evenly across the rows and columns of the grid.fixed for Haskell. I approximated the odds as used in JS for simplicity, and bumped up the number of tests to 200 to make even more sure every scenario will be tested.
@JohanWiltink Haskell should also generate some random cases with x = pow2 -> (x, x)
fixed for JS & Python
Not fixed tests plural, in different categories ( ie lines in the example ). There's something to be said for more extensive fixed edge case tests.
17
definitely equals17
though. :PETA: wrote this before I saw the previous comment
Are you sure about this statement?
At least in JS, there are random tests with
a == b
, but not fixed tests, so some solutions pass/fail randomly.<
or<=
is a choice. it was made in favour of<
.==
can be derived from<=
but not<
, but that's no reason to choose<=
over<
.Closing.
JS Translation
Rejected by someone (?
Loading more items...