Sha256: 992c8aaec2d275da3eaf55f90e77447868aa1547789d71f2d911acd3c8a39f46

Contents?: true

Size: 476 Bytes

Versions: 37

Compression:

Stored size: 476 Bytes

Contents

import 
    roman_numerals, unittest, tables

let numerals = {
    1: "I",
    2: "II",
    3: "III",
    4: "IV",
    5: "V",
    6: "VI",
    9: "IX",
    27: "XXVII",
    48: "XLVIII",
    49: "XLIX",
    59: "LIX",
    93: "XCIII",
    141: "CXLI",
    163: "CLXIII",
    402: "CDII",
    575: "DLXXV",
    911: "CMXI",
    1024: "MXXIV",
    3000: "MMM",
}.toTable

test "test numerals":
    for arabic, numeral in numerals.pairs:
        check numeral(arabic) == numeral

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
trackler-2.2.1.172 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.171 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.170 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.169 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.167 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.166 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.165 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.164 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.163 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.162 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.161 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.160 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.159 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.158 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.157 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.156 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.155 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.154 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.153 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.152 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim