Earn extra honor and gain new allies!
Honor is earned for each new codewarrior who joins.
Learn more
  • ranks can't be changed

  • This kata is definitely underrated; should be ~4 kyu in my opinion.

  • Java and C# version fixed.Try it again~

  • Java and C# version fixed.Try it again~

  • It's in Javascript as well and it is rather annoying - you have to read the comments to find out that even though tests testify a working encoder code it is your encoder code you have to fix to pass the random DECODING tests.
    Would be a nice kata otherwise, but with that test setup it's a pain in the ass for all bit shifters....

  • To say there's a C++ version of this Kata is stretching things somewhat. The challenge's "interface" is identical to the C version. Instead of this:

    struct block { const char *data; int n; };
    char *toAscii85 (block b);
    block fromAscii85 (const char *string);
    

    what about this?

    std::string toAscii85(std::vector<char>&);
    std::vector<char>& fromAscii85 (const std::string&);
    

    and you could get rid of the block struct and those macros, which while tolerated in C, are considered bad practice in C++ (even more so lower case ones). It also doesn't force the caller to manage the memory of the returned pointers (the sample tests as they stand leak memory).

  • I've tested the same solution code of mine for Python 2.7.6 and Python 3.4.3 just now and both pass all final test cases. I think there is no issue if you aren't using version-specific stuff.

  • B116013, check out mgol's answer. I think there is no issue. Please open a new question if you still have one.

  • I've tested the same solution code of mine for Python 2.7.6 and Python 3.4.3 just now and both pass all final test cases. I think there is no issue if you aren't using version-specific stuff.

  • Hey there!

    I guess that your not escaping correctly the test cases for c++. Could you check if you are escaping correctly special caracters in the refence string, such as backslash '\'.

    Under a certain test case, whithin the test "Now is the time for all good men to come to the aid of their country". The test shows a mismatch.

    I've tried two different implementations (With C old plain strings and C++ std::string) both return the same output. Even thought only the std::string approach works correctly on this test case. I've compared the encoded values on several tools to compare and my output look like correct.

    This is the output with the problem.

    b.data: (Now is the time for all good men to come to the aid of their country) b.n: (68)
    total_tuples: 17
    4e 6f 77 20 ENCODING! !>b2: 21 3e 62 32 3a - 'Now '
    69 73 20 74 ENCODING! =DblB 3d 44 62 6c 42 - 'is t'
    68 65 20 74 ENCODING! .<rOB 2e 3c 72 4f 42 - 'he t'
    69 6d 65 20 ENCODING! (E.lB 28 45 2e 6c 42 - 'ime '
    66 6f 72 20 ENCODING! 4]DoA 34 5d 44 6f 41 - 'for '
    61 6c 6c 20 ENCODING! &aK;@ 26 61 4b 3b 40 - 'all '
    67 6f 6f 64 ENCODING! !^_5B 21 5e 5f 35 42 - 'good'
    20 6d 65 6e ENCODING! -\kD+ 2d 5c 6b 44 2b - ' men'
    20 74 6f 20 ENCODING! ENVE+ 45 4e 56 45 2b - ' to '
    63 6f 6d 65 ENCODING! q3Hr@ 71 33 48 72 40 - 'come'
    20 74 6f 20 ENCODING! ENVE+ 45 4e 56 45 2b - ' to '
    74 68 65 20 ENCODING! .5,DF 2e 35 2c 44 46 - 'the '
    61 69 64 20 ENCODING! p60;@ 70 36 30 3b 40 - 'aid '
    6f 66 20 74 ENCODING! 6,:eD 36 2c 3a 65 44 - 'of t'
    68 65 69 72 ENCODING! umtOB 75 6d 74 4f 42 - 'heir'
    20 63 6f 75 ENCODING! 4>fC+ 34 3e 66 43 2b - ' cou'
    6e 74 72 79 ENCODING! EoKKD 45 6f 4b 4b 44 - 'ntry'

    <:2b>!BlbD=BOr<.Bl.E(AoD]4@;Ka&B5_^!+Dk-+EVNE@rH3q+EVNEFD,5.@;06pDe:,6BOtmu+Cf>4DKKoE>

    3c 7e 3a 32 62 3e 21 42 6c 62 44 3d 42 4f 72 3c 2e 42 6c 2e 45 28 41 6f 44 5d 34 40 3b 4b 61 26 42 35 5f 5e 21 2b 44 6b 5c 2d 2b 45 56 4e 45 40 72 48 33 71 2b 45 56 4e 45 46 44 2c 35 2e 40 3b 30 36 70 44 65 3a 2c 36 42 4f 74 6d 75 2b 43 66 3e 34 44 4b 4b 6f 45 7e 3e

    Could you take a look at this please?

  • Java version has an error in the random test - test_ASCII85_decoding_with_random_readable_input
    Some groups of characters from test strings decode to a value greater than 4294967295L for example: group "PF&'" decodes to 4309582881

    In the kata description it was necessary to pay more attention to error handling

  • huh, you dont have to specify var, let, etc... on variables, I like it

  • Ok. Thanks. That worked

  • Got it finally, I cast to unsigned char instead of char like ZajkoUsko recommended.

  • Loading more items...