As a programming exercise, this is pretty neat. Not, as LizBo says, real practical, though. In English, lots of words exist to break the rules. Dice is one of them> Dice is the plural of die, but only when referring to the ones you roll. So two or more are dice, and one is a die. No dices.
Good, if superfluous, work!