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.
We need to solve a retired kata as prerequisite to complete this kata :/
As certain comments noted below, the kata premise is incorrect: there are almost infinitely many encodings that can perform this task, but the kata assumes one scheme and asks us to guess (read: read kata author's mind) the scheme and derive the result using this scheme.
A proper testing scheme would need to have us provision the scheme, then read the result using said scheme, such as this kata.
Sample tests are not using
it
blocks in Python.In Swift translation a tests pass in green but the solution returns an error:
main.swift:19:13: warning: variable 'asciiValues' was never mutated; consider changing to 'let' constant
var asciiValues = text.asciiArray
~~~ ^
let
Rust translation
Duplicate of many other, better quality caesar cypher katas
A little typo in the description:
we are doing *spe[C]ial XOR*
The test cases are missing the required imports for
java.util.Arrays
as well as fororg.junit.Assert
andorg.junit.Test
. I think it should really not be put on the shoulders of the solver of this kata to fix the imports to be able run the local test cases at all.The description is especially unclear and needs to be reworked:
every element in odd position is shifted forward
:the nth char
or as indexes (== "0 indexed"). As a matter of fact, most could expect the latter, but that's not what you use.That's incorrect: you're passing strings, not a list.
EDIT:
Extending
Array.prototype
should be done with a modicum of care.for ( let i in a )
should not enumerate the prototype method afterflatMap
has been defined, or interesting bugs might ensue. This has happened in practice: I have definedArray.prototype.flatMap
( I called itconcatMap
) in kata, and the tests would break.Enumerability of the new prototype method should be tested. Alternatively, plain
flatMap(fn,arr)
could be requested instead of a prototype method.I think this is an important point to teach people.