Program Challenge (was Re: z80 timing... 6502 timing)

From: Merle K. Peirce <at258_at_osfn.org>
Date: Mon Apr 19 18:07:25 1999

I just looked at a reference which mentioned an inscription in the Forum
on the columna rostrata commemorating the victory of the Carthaginians in
260 BC which had 23 (I)'s inscribed, where I=1,000.

On Mon, 19 Apr 1999, Fred Cisin (XenoSoft) wrote:

> On Sun, 18 Apr 1999, Sean 'Captain Napalm' Conner wrote:
> > Problem: Convert a binary value to Roman, using ASCII characters (or
> > the native character set if applicable) into a string
> > with a termination character (if ASCII, use the NUL (0)
> > character).
> >
> > The valid Roman characters used are:
> >
> > I 1
> > V 5
> > X 10
> > L 50
> > C 100
> > D 500
> > M 1000
> >
> > I will assume that all are familiar with how the conversion
> > goes 8-) The smallest value allowed is 1, and the largest
> > is 3,999. Any value out of this range is to be represented
> > as a single character consisting of an asterick (*) or some
> > other similar character in whatever character set (if ASCII
> > isn't supported) followed by the termination character.
> >
> > This means that the longest string is 10 characters long:
> >
> > `M' `M' `M' `C' `M' `X' `C' `I' `X' <termination>
>
> I must be missing something here. 9 does NOT produce the longest string
> < 10, 8 does. (IX v VIII), and 3999 isn't the longest string.
>
> 3888 would seem to produce:
> M M M D C C C L X X X V I I I \0
> which is 16 characters, including null.
>
> BTW, what comes after M? Is it correct that in Roman numerals there can
> never be 4 consecutive occurences of the same letter? (The original Y4M
> "bug"!!!)
>
> --
> Fred Cisin cisin_at_xenosoft.com
> XenoSoft http://www.xenosoft.com
> 2210 Sixth St. (510) 644-9366
> Berkeley, CA 94710-2219
>
>

M. K. Peirce
Rhode Island Computer Museum, Inc.
215 Shady Lea Road,
North Kingstown, RI 02852

"Casta est qui nemo rogavit."
              
              - Ovid
Received on Mon Apr 19 1999 - 18:07:25 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:31:44 BST