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.151 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.150 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.149 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.148 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.147 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.146 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.145 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.144 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.143 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.142 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.141 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.140 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.139 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.138 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.137 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.136 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim
trackler-2.2.1.135 tracks/nim/exercises/roman-numerals/roman_numerals_test.nim