Sha256: 71fa8e6838d1c180b347986ee9f14aa45b34b35ab78f3b500c8c6d53523fad1b

Contents?: true

Size: 1.39 KB

Versions: 34

Compression:

Stored size: 1.39 KB

Contents

{
  "to_decimal": {
    "description": "returns the decimal representation of the input trinary value",
    "cases": [
      {
        "description": "trinary 1 is decimal 1",
        "input": 1,
        "expected": 1
      },
      {
        "description": "trinary 2 is decimal 2",
        "input": 2,
        "expected": 2
      },
      {
        "description": "trinary 10 is decimal 3",
        "input": 10,
        "expected": 3
      },
      {
        "description": "trinary 11 is decimal 4",
        "input": 11,
        "expected": 4
      },
      {
        "description": "trinary 100 is decimal 9",
        "input": 100,
        "expected": 9
      },
      {
        "description": "trinary 112 is decimal 14",
        "input": 112,
        "expected": 14
      },
      {
        "description": "trinary 222 is decimal 26",
        "input": 222,
        "expected": 26
      },
      {
        "description": "trinary 1122000120 is decimal 32091",
        "input": 1122000120,
        "expected": 32091
      },
      {
        "description": "invalid trinary digits returns 0",
        "input": "1234",
        "expected": 0
      },
      {
        "description": "invalid word as input returns 0",
        "input": "carrot",
        "expected": 0
      },
      {
        "description": "invalid numbers with letters as input returns 0",
        "input": "0a1b2c",
        "expected": 0
      }
    ]
  }
}

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
trackler-2.0.8.13 common/exercises/trinary/canonical-data.json
trackler-2.0.8.12 common/exercises/trinary/canonical-data.json
trackler-2.0.8.11 common/exercises/trinary/canonical-data.json
trackler-2.0.8.10 common/exercises/trinary/canonical-data.json
trackler-2.0.8.9 common/exercises/trinary/canonical-data.json
trackler-2.0.8.8 common/exercises/trinary/canonical-data.json
trackler-2.0.8.7 common/exercises/trinary/canonical-data.json
trackler-2.0.8.6 common/exercises/trinary/canonical-data.json
trackler-2.0.8.5 common/exercises/trinary/canonical-data.json
trackler-2.0.8.4 common/exercises/trinary/canonical-data.json
trackler-2.0.8.3 common/exercises/trinary/canonical-data.json
trackler-2.0.8.2 common/exercises/trinary/canonical-data.json
trackler-2.0.8.1 common/exercises/trinary/canonical-data.json
trackler-2.0.7.0 common/exercises/trinary/canonical-data.json
trackler-2.0.6.44 common/exercises/trinary/canonical-data.json
trackler-2.0.6.43 common/exercises/trinary/canonical-data.json
trackler-2.0.6.42 common/exercises/trinary/canonical-data.json
trackler-2.0.6.41 common/exercises/trinary/canonical-data.json
trackler-2.0.6.40 common/exercises/trinary/canonical-data.json
trackler-2.0.6.39 common/exercises/trinary/canonical-data.json