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.
Looks like your code is mutating the list, which is not allowed by the kata and the reason for the weird side effect you are seeing.
Trying running this on your code, which will give the wrong answer, just like in the test you posted:
I'm sorry but what is this even supposed to mean (Attempt tests)?
l0 = List.iterate(inc,0), l1 = [0,1,2,3,4,5,6,7,8,9], l2 = l0.take(10)
l1 === l2
l1 === l2
expected [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] to deeply equal [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
Where does [ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 ] come from? I do console.log(List.iterate(inc, 0).take(10).toList()); and it prints [
0, 1, 2, 3, 4,
5, 6, 7, 8, 9
]
Same question to the following:
l = List.iterate(inc,0)
l.head()
l.tail().head()
l.tail().take(3)
expected [ 2, 3, 4 ] to deeply equal [ 1, 2, 3 ].
I'm not sure what you are getting at here, but what I can say is:
So in your example, I see two issues:
10b2= 1.1b2 -> 1.1b2 != floor(1.1b2)Please let me know if I have missed your point.
The following info:
The interesting thing about polydivisiblity is that it relates to the underlying number, but not the base it is written in, so if aliens came to Earth and used base 23 (11 fingers on one hand and 12 on the other), no matter what squiggles they use to write numbers, they would find the same numbers polydivisible!
As well as this:
...(and a polydivisible base 10 number when converted to 11100 in base 10).
seems to be misleading. For example, number 3 (base 10) is polydivisble in base 10, but the same "underlying number" in base 2 (11) is not polydivisble.
And 11100 is not polydivisble in base 10...