Ad
  • Custom User Avatar

    Why is this Kata asking you to encode strings to Base64? Base64 is fundamentally a binary codec, that is it's raison d'ĂȘtre after all.

    Currently, some of the translations here don't even have random tests to cover decoding, presumably because the authors of those translations found it hard to generate random Base64 data that's still decodable as text (be it from ASCII or from UTF-8; the trick is to generate random text, encode that to UTF-8 or ASCII and from there to Base64).

    Can we discuss getting the one Base64 kata on CW in a better shape and actually encode from binary to Base64 and vice versa?

  • Custom User Avatar

    I created a Rust translation, please review and approve!

    On second thought, lets not use that one. I've started creating translations across all the languages here to fix a series of issues with this kata and the Rust version has had an update to match that. See other posts in this discourse.

  • Custom User Avatar

    Note: This kata uses the non-padding version ("=" is not added to the end).

    This is enforced in Python, but not in C# and JavaScript

  • Custom User Avatar
    • The function name should be in camelCase
    • There's no reason to use classes for this task
    • The tests modify Player instances after creation (not an issue per se, but there's no reason to do so, and this can lead to unexpected bugs in otherwise perfectly valid solutions)
    • There's already a kata about calculating Blackjack score, and the added task of comparing values doesn't make this kata more interesting
  • Custom User Avatar

    No random tests.

  • Custom User Avatar

    C# tests are not updated?

    Instruction says that non-padding version is used. How come I still get this message?

    Test Failed
    Expected string length 20 but was 18. Strings differ at index 18.
    Expected: "cGFkZGluZywgc2lyPw=="
    But was: "cGFkZGluZywgc2lyPw"

  • Custom User Avatar

    I think more test cases are in order, optimally a couple of hundred random test cases or more. If you want, you can PM on gitter (use my github name) and I can help create random test cases.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    If the player's hand is [7, 3, 11] and the dealer's is [4, 7, 11, 9], who should win?

    The way I understand the requirements, the dealer should win, but some solutions will say that the player did.

    • the player didn't get 21 on the first two cards
    • the player hasn't exceeded 21 but also hasn't reached a higher final score than the dealer (they're tied)
    • the dealer's hand didn't exceed 21

    So we have a tie and house rules say that the dealer wins.

    Am I reading this correctly? Anyway, either way, it would be a good test case to add, I think.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution